Hi,
at the moment, I'm playing around with XPath (using the command line tool of today's CVS build).
I have inserted the document http://www.jeckle.de/vorlesung/xml/examples/projektverwaltung4.xml under the collection /db/test/ .
This query works fine:
./xindice xpath -c /db/test/ -q "//Person[count(Vorname)=1]/Nachname[following-sibling::[EMAIL PROTECTED]/parent::Person/"
But using this query (in order to access the attribute "@mitarbeitInProjekt") ...:
./xindice xpath -c /db/test/ -q "//Person[count(Vorname)=1]/Nachname[following-sibling::[EMAIL PROTECTED]/parent::Person/@mitarbeitInProjekt"
... I get:
trying to register database
org.xmldb.api.base.XMLDBException: Failed to execute command 'Query' on server: http://127.0.0.1:8888/xindice/, message: java.lang.Exception: org.w3c.dom.DOMException: This Node Cannot Contain This Child
at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:124)
at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.query(CollectionImpl.java:515)
at org.apache.xindice.client.xmldb.XindiceCollection.query(XindiceCollection.java:259)
at org.apache.xindice.client.xmldb.services.QueryService.query(QueryService.java:90)
at org.apache.xindice.tools.command.XPathQuery.execute(XPathQuery.java:75)
at org.apache.xindice.tools.XMLTools.execute(XMLTools.java:293)
at org.apache.xindice.tools.XMLTools.process(XMLTools.java:171)
at org.apache.xindice.tools.XMLTools.main(XMLTools.java:82)
Caused by: org.apache.xmlrpc.XmlRpcException: java.lang.Exception: org.w3c.dom.DOMException: This Node Cannot Contain This Child
at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java)
at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:112)
... 7 more
[EMAIL PROTECTED]: java.lang.Exception: org.w3c.dom.DOMException: This Node Cannot Contain This Child
at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java)
at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:112)
at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.query(CollectionImpl.java:515)
at org.apache.xindice.client.xmldb.XindiceCollection.query(XindiceCollection.java:259)
at org.apache.xindice.client.xmldb.services.QueryService.query(QueryService.java:90)
at org.apache.xindice.tools.command.XPathQuery.execute(XPathQuery.java:75)
at org.apache.xindice.tools.XMLTools.execute(XMLTools.java:293)
at org.apache.xindice.tools.XMLTools.process(XMLTools.java:171)
at org.apache.xindice.tools.XMLTools.main(XMLTools.java:82)
Caused by: org.apache.xmlrpc.XmlRpcException: java.lang.Exception: org.w3c.dom.DOMException: This Node Cannot Contain This Child
at org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java)
at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:112)
at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.query(CollectionImpl.java:515)
at org.apache.xindice.client.xmldb.XindiceCollection.query(XindiceCollection.java:259)
at org.apache.xindice.client.xmldb.services.QueryService.query(QueryService.java:90)
at org.apache.xindice.tools.command.XPathQuery.execute(XPathQuery.java:75)
at org.apache.xindice.tools.XMLTools.execute(XMLTools.java:293)
at org.apache.xindice.tools.XMLTools.process(XMLTools.java:171)
at org.apache.xindice.tools.XMLTools.main(XMLTools.java:82)
ERROR : Failed to execute command 'Query' on server: http://127.0.0.1:8888/xindice/, message: java.lang.Exception: org.w3c.dom.DOMEx
Is this a bug in Xindice, or is my XPath query just plain wrong? If it is wrong, how can I get this attribute's value as a result?
Thanks in advance,
Oliver
-- Oliver Klee Fraunhofer Institute for Applied Information Technology (FhG-FIT) Office C5-118b, Schloss Birlinghoven, 53754 Sankt Augustin Phone +49 02241 14-2943, Mobile +49 179 9594731
