Hi,
I am trying to locate an element in a WordML XML document using XPath.
The structure looks like:
...
<w:body>
<wx:sect>
<aml:annotation aml:id="0" w:type="Word.Bookmark.Start" w:name="DOC0000966"/>
...
So I use the following expression
"/wordDocument//body/sect"
wich gives me a list with the <w:sect> nodes.
Then I search for
"annotation[@type='Word.Bookmark.Start']"
starting from each <w:sect> node. This yields the <aml:annotation> elem.
So far so good.
Now I have to handle a second case as well.
...
<w:body>
<wx:sect>
<w:p>
<aml:annotation aml:id="0" w:type="Word.Bookmark.Start" w:name="DOC0000966"/>
...
As you can see the <aml:annotation> is nested inside a <w:p> elem.
My intention was to use the expression
"//annotation[@type='Word.Bookmark.Start']"
to handle both cases, but this expression does not match neither.
I have tried several different alternatives with expressions and NamingContext implementations, none working.
What am I missing?
Thanks in advance,
Mariano.