You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Yoann HENRY <y....@proxiad.com> on 2007/11/21 11:01:33 UTC
XPath Request Into XML File
Hi,
I would like to know if we can made an XPath query into an XML file saved as
a binary in the JCR repo.
I have saved an XML file into a Node (myFileNode) and I would like to get
some informations saved in the file.
JCR Structure:
/
|- myFileNode
| |-jcr:contains (property)
| |-XML file as binary
|-anOtherNode
XML file:
<root>
<child1>
<child12>the value to find</child12>
</child1>
</root>
XPath query:
//myFileNode[jcr:contains]/child1/child12
I would like to obtain the value of the element named child12.
I tested with the query above and it doesnt work, it looks for a Node named
child1 or it must go into the XML file to find it.
Is there a solution to do it??
Thanks
cid:image001.jpg@01C7BCCA.C5A37CB0
Yoann HENRY
ProxiAD IDF
12, rue de la chaussée d'Antin
75009 Paris
( : 01 49 49 05 38
Fax : 01 49 49 05 40
) : 06 87 33 83 95
+: <ma...@proxiad.com> y.henry@proxiad.com
RE: XPath Request Into XML File
Posted by Ard Schrijvers <a....@hippo.nl>.
> Hi,
>
> I would like to know if we can made an XPath query into an
> XML file saved as a binary in the JCR repo.
>
No this is not possible. XPath queries are done on nodes and properties.
If you need to query the xml with XPath, I think you should either store
every xml element as a node and attribute as a property (though this
might get way to big ofcourse) or fetch the xml binary file and parse
it.
Ard
>