xpath - msxml selectnodes: namespace in text node -


i have following xml file:

<root xmlns="http://someurl/element" xmlns:text="http://someurl/text">    <elements>      <element>        <id>text:some_id</id>        <!-- other elements -->      </element>      <element>        <!-- other elements -->        <reference>           <link ref="text:some_id" />        </refernce>      </element>    </elements> </root> 

i want select child elements of elment node have element id=text:some_id reference node. want in c++ using selectnodes method of ixmldomnode object msxml parser.

in following exmaple have refence node selected in pchild , selectionnamespaces propetey set xmlns:n="http://someurl/element":

msxml2::ixmldomnodeptr pselectednodes =     pchild->selectnodes("../../n:element[n:id=n:link/@ref]/n:*"); __assert(pselectednodes->length > 0) 

this not working. doing wrong?

the n:link/@ref part of xpath query evaluated in context of element conditional criteria applied; in case ../../n:element.
can’t reference overall context within conditional section; in other words, context node different inside , outside of [square brackets].

i’m afraid have extract pchild->selectsinglenode("n:link/@ref")->text separately, , 'manually' insert xpath query.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -