You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Don Stewart <Do...@corizon.com> on 2005/04/04 15:15:37 UTC

Saxon 8.1, Xpath and SOAP

Hi,
 
Quesion by default what does XmlBeans do about Namespaces when loading
the schema.
 
The reason I ask is I have a schema with 3 namespaces I know this
because that is the result of:-
 
            EnvelopeDocument lEnvelope =
EnvelopeDocument.Factory.parse(response.getSOAPPart().getEnvelope());
            lCursor = lEnvelope.getEnvelope().getBody().newCursor();
            System.out.println("lCursor : " + lCursor.xmlText());
            lCursor.getAllNamespaces(lNamespaces);
            Iterator namespaceIter = lNamespaces.keySet().iterator();
            System.out.println(lNamespaces.size() + " : namespaces in
Xml");
 
I'm getting an exceptiong when I execute a query with Saxon in Xmlbeans.
 
The line is :-
 
 
lCursor.selectPath("/soap:Envelope/soap:Body/soap:Fault");
 
(also tried with ("/soap:Envelope[1]/soap:Body[1]/soap:Fault[1] which
fails. //faultcode which resolves to 
/soap:Envelope[1]/soap:Body[1]/soap:Fault[1]/faultcode works just fine)
Exception in thread "main" java.lang.RuntimeException:
net.sf.saxon.xpath.StaticError: XPath syntax error at char 15 in
{./soap:Envelope/soap:Body}:

Prefix soap has not been declared

at
org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath.selectNodes(XBeansXPath
.java:95)


I know that soap is one of them as I've single step debugged the code
and it's the 3rd of the 3.
 
Many Thanks
 
Don