Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>After registering the bindings of the prefixes to the corresponding namespaces, use</strong>:</p> <pre><code> /*/s:Body /s:About_ServiceResponse /s:About_ServiceResult /a:businessServiceVersionStructureField /a:BusinessServiceVersionStructureType /a:businessServiceVersionNameField /text() </code></pre> <p><strong>When this XPath expression is evaluated against the following XML document</strong> (the provided one is severely malformed and I had to spend considerable time to make it well-formed):</p> <pre><code>&lt;s:Envelope xmlns:s="http://..."&gt; &lt;s:Body&gt; &lt;About_ServiceResponse xmlns="http://..."&gt; &lt;About_ServiceResult xmlns:a="http://"&gt; &lt;a:businessServiceVersionStructureField&gt; &lt;a:BusinessServiceVersionStructureType&gt; &lt;a:businessServiceDBVersionNameField&gt;V001&lt;/a:businessServiceDBVersionNameField&gt; &lt;a:businessServiceVersionNameField&gt;Some Service^V100&lt;/a:businessServiceVersionNameField&gt; &lt;/a:BusinessServiceVersionStructureType&gt; &lt;/a:businessServiceVersionStructureField&gt; &lt;/About_ServiceResult&gt; &lt;/About_ServiceResponse&gt; &lt;/s:Body&gt; &lt;/s:Envelope&gt; </code></pre> <p><strong>Exactly the wanted text node is selected</strong>:</p> <pre><code>Some Service^V100 </code></pre> <p><strong>In case you want to select the element that is the parent of this text node, use</strong>:</p> <pre><code> /*/s:Body /s:About_ServiceResponse /s:About_ServiceResult /a:businessServiceVersionStructureField /a:BusinessServiceVersionStructureType /a:businessServiceVersionNameField </code></pre> <p><strong>XSLT - based verification</strong>:</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://..." xmlns:a="http://"&gt; &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt; &lt;xsl:template match="/"&gt; &lt;xsl:copy-of select= "/*/s:Body /s:About_ServiceResponse /s:About_ServiceResult /a:businessServiceVersionStructureField /a:BusinessServiceVersionStructureType /a:businessServiceVersionNameField /text() "/&gt; ======= &lt;xsl:copy-of select= "/*/s:Body /s:About_ServiceResponse /s:About_ServiceResult /a:businessServiceVersionStructureField /a:BusinessServiceVersionStructureType /a:businessServiceVersionNameField "/&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p><strong>When this transformation is applied against the same XML document (above), the selected nodes are output</strong> (using "=======" as delimiter):</p> <pre><code>Some Service^V100 ======= &lt;a:businessServiceVersionNameField xmlns:a="http://" xmlns="http://..." xmlns:s="http://..."&gt;Some Service^V100&lt;/a:businessServiceVersionNameField&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