I realize that this was discussed a little while ago but I couldn't seem
to find any final answer. I'm trying to query a document that uses
namespaces throughout. Not using namespaces is not an option for us. An
excerpt from the document is below:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:ObsProject xmlns:ns1="Alma/ObsPrep/ObsProject">
<ns1:ObsProjectEntity entityId="uid://X0000000000000001/X00000100"
entityIdEncrypted="-- id encryption not yet implemented --"
entityTypeName="ObsProject"/>
<ns1:ObsProposalRef entityId="uid://X0000000000000001/X00000101"
entityTypeName="ObsProposal" entityVersion="latest"/>
<ns1:ObsProgram code="aaa">
the query I'm trying to perform is very simple
/ns1:ObsProject
This should select every document with this root node in the database.
all this is being done with code that looks like:
service = (XPathQueryService)collection.getService("XPathQueryService",
"1.0");
ResourceSet resultSet= service.query(query);
where query is the string obove.
this query causes an exception to be thrown:
org.xmldb.api.base.XMLDBException: Query error
Does anyone have any clue how I can get this query to return something.
The same query without the namespace returns no results.
Thanks,
Simon Farrow.