Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Use</strong>:</p> <pre><code>/*/L/D/node() </code></pre> <p>This selects all nodes (elements, text-nodes, processing-instructions and comment-nodes) that are children of any <code>D</code> element that is a child of any <code>L</code> element that is a child of the top element of the XML document.</p> <p><strong>Alternatively, you could select separately all the node-children of the two <code>/*/L/D</code> elements</strong>:</p> <pre><code>/*/L[1]/D/node() </code></pre> <p><strong>and</strong></p> <pre><code>/*/L[2]/D/node() </code></pre> <p><strong>Verification using XSLT as host of XPath</strong>:</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt; &lt;xsl:template match="/"&gt; &lt;xsl:copy-of select="/*/L[1]/D/node()"/&gt; -------------------- &lt;xsl:copy-of select="/*/L[2]/D/node()"/&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p><strong>when applied on the provided XML document</strong>:</p> <pre><code>&lt;MAIN&gt; &lt;L&gt; &lt;D&gt;string1 string2 &lt;b&gt;string3&lt;/b&gt; string4 &lt;/D&gt; &lt;/L&gt; &lt;L&gt; &lt;D&gt;string5 string6 &lt;b&gt;string7&lt;/b&gt; string8 &lt;i&gt;string9&lt;/i&gt; &lt;/D&gt; &lt;/L&gt; &lt;/MAIN&gt; </code></pre> <p><strong>the wanted, correct result is produced</strong>:</p> <pre><code>string1 string2 &lt;b&gt;string3&lt;/b&gt; string4 -------------------- string5 string6 &lt;b&gt;string7&lt;/b&gt; string8 &lt;i&gt;string9&lt;/i&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload