Hello, I tried to use this utility for processing ODF documents and noticed that it seems to be unable to generate unique XPaths to traverse each of the elements in an XML document.
For example, the following XML source markup snippet:
<text:p text:style-name="Text_20_body"/>
<text:h text:style-name="Heading_20_1" text:outline-level="1"><text:bookmark-start text:name="__RefHeading___Toc103_2364876554"/>References<text:bookmark-end text:name="__RefHeading___Toc103_2364876554"/></text:h>
<text:p text:style-name="Text_20_body">T.B.D.</text:p>
<text:p text:style-name="Text_20_body"/>
</office:text>
</office:body>
</office:document-content>
resulted in the following XPaths:
office:document-content/office:body/office:text/text:p[@text:style-name='Text_20_body']
office:document-content/office:body/office:text/text:h[@text:style-name='Heading_20_1' and @text:outline-level='1']
office:document-content/office:body/office:text/text:h/text:bookmark-start[@text:name='__RefHeading___Toc103_2364876554']
office:document-content/office:body/office:text/text:h/text:bookmark-end[@text:name='__RefHeading___Toc103_2364876554']
office:document-content/office:body/office:text/text:p[@text:style-name='Text_20_body']
office:document-content/office:body/office:text/text:p[@text:style-name='Text_20_body']
which is not unique for any of the elements that shares the office:document-content/office:body/office:text/text:p[@text:style-name='Text_20_body']
XPath.
Please support a way to generate unique XPaths so that wone can traverse the entire input XML document using them, thanks in advance!
I would like to note that I was previously using the
xmlstarlet elements -v
command to generate the XPaths.Version information:
Typo fix of the original post:
s/wone/one/