[xml] XPath question



I am relatively new to XPath, so perhaps there is something I don't
understand here.  I am using the following XPath expression:

/MyElement

to try and match the following simple node:

<MyElement
xmlns="http://test.commerceone.com/global_element/SimpleTypeNested";>true</My
Element>

This is coming back as a non-match. Apparently something in the namespace
declaration is causing this.  If I remove that, or replace it with an
attribute of a different name, the match is done OK.  The question is, if
information on the namespace is required in the expression, what should it
be?  Since it is the default namespace, it does not have a prefix.  So I
don't know how to get this to match.

I am using the latest version of libxml2, but I am not sure this is a
libxml2 problem.  I got the same result when I used a different XPath tool.
I am hoping some XPath guru out there can tell me what I am doing wrong.

Regards,

Ed Day
Objective Systems, Inc.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]