Are you binding up a NamespaceContext somewhere?

The XPath needs to know what the 'xs:' prefix refers to.  It doesn't
pull it from the target document.  You need a NamespaceContext (or,
I think XPath has convenience methods for setting a namespace-prefix
mapping directly upon it).


        -bob



On Mon, 29 Apr 2002, Matt Smith wrote:

> Hello all -
> 
> I've been looking into Jaxen today because I was having performance problems
> with XPathAPI. However, I've run into a problem where Jaxen returns on one
> of my xml schema documents, whereas XPathAPI does not. I assumed I was doing
> something wrong, so I wrote some test cases and have it boiled down to this:
> 
> I have the following java snippet as a test (after loading a DOM Document)
> 
>   XPath path = new DOMXPath("/xs:schema/xs:element']");
>   System.out.println(path.selectSingleNode(doc));
> 
> which operates correctly and generates [xs:element: null] for the following
> document:
> <xs:schema>
>     <xs:element/>
> </xs:schema>
> 
> but which fails and outputs "null" for the following:
> 
> <xs:schema xmlns:xs="foo">
>     <xs:element/>
> </xs:schema>
> 
> Any reason that might be?
> 
> Thanks,
> -Matt
> 
> 
> _______________________________________________
> Jaxen-interest mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jaxen-interest
> 


_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to