1

Topic: XPATH and a name space

Hello.
Attended to application of requests xpath to xml to documents

<Document xmlns:xxx = "www.sql.ru" xmlns = "www.ya.ru">
<xxx:main>
<xxx:month> 3 </xxx:month>
<xxx:org>
<xxx:Num> 11111111111 </hxx:Num>
</xxx:org>
</xxx:main>
</Document>

Tried to search so

objNode: = xmlDoc. SelectSingleNode (' Document/main/org/Num ');

Does not find. Returns NULL
I suspect that it because of two name spaces.
How in this case to find ?
Thanks

2

Re: XPATH and a name space

sergq;
Parcer name?

3

Re: XPATH and a name space

Very Pavlovny dream;
If correctly understood a question, ms
Tried to specify name spaces through SelectionNamespaces - did not help

4

Re: XPATH and a name space

sergq wrote:

Son Very Pavlovny;
If correctly understood a question, ms
Tried to specify name spaces through SelectionNamespaces - did not help

No, incorrectly. A name of frejmvorka/library/program, which you . At different parcers xmlns are set by different methods.

5

Re: XPATH and a name space

xmlDoc.setProperty ("SelectionNamespaces", "xmlns:a ='www.ya.ru ' xmlns:b ='www.sql.ru '");
objNode: = xmlDoc. SelectSingleNode (' a:Document/b:main/b:org/b:Num ');