Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: XPath-Query should include also root XPath-Query should include also rootTo: NULL Date: 11/12/2007 10:09:00 PM
Hello,
I have to parse different partial XML-nodes. I want
get root or a child node if it has a specified attribute.
But I get only childs at the moment. How can I get
also the root node if it has the attribute?
Sample:
a)
<MyTag MyAttribute='true'>MyText</MyTag>
b)
<MyRoot>
<MyTag MyAttribute='true'>MyText</MyTag>
</MyRoot>
c)
<MyRoot>
<MyParent>
<MyTag MyAttribute='true'>MyText</MyTag>
</MyParent>
</MyRoot>
How can I query a) and b) for the attribute
MyAttribute ?
Actually "//*[@MyAttribute]" works only for
childs (b, c). But I need it also for a) in the same
query like this expression :
"Select the root or child or descendant which
has an attribute MyAttribute".
Regards
Holger
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
