Answer the question
In order to leave comments, you need to log in
How to find out the path to the xml element?
there is xml:
<w:body>
<w:p>
<w:text>Текст</w:text>
</w:p>
</w:body>
Answer the question
In order to leave comments, you need to log in
for example, on Xquery you can do this
declare namespace w = "w";
declare function local:recursion ( $node as element() ) as xs:string {
if ( $node/parent::* )
then (
local:recursion ( $node/parent::* ) || "/" || $node/name() ||
"[" || count( $node/preceding-sibling::*[ name() = $node/name() ] )+1 || "]"
)
else ( $node/name() )
};
let $xml :=
<w:body>
<w:p>
<w:text>Текст</w:text>
</w:p>
<w:p>
<w:text>Текст</w:text>
<w:text>Текст</w:text>
</w:p>
</w:body>
for $node in $xml//w:text
return
local:recursion( $node )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question