Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>POCollection</code> in sample.xml has default namespace <code>xmlns="http://www.amway.com/PurchaseOrder/1.0"</code></p> <p>So why you define <code>xmlns:d="http://www.default.ns/</code> in your XSLT? </p> <pre><code>&lt;!-- in input xml is no element from "http://www.default.ns" namespace --&gt; &lt;xsl:value-of select="/d:POCollection/ns1:PurchaseOrder/ns1:PurchaseOrderHeader/ns1:OUAddressLine1" /&gt; &lt;!-- Element ns1:PurchaseOrder is not document element (the outermost element) in input xml --&gt; &lt;xsl:value-of select="/ns1:PurchaseOrder/ns1:PurchaseOrderHeader/ns1:OUAddressLine1" /&gt; &lt;!-- There is no element POCollection from null namespace in input xsml --&gt; &lt;xsl:value-of select="/POCollection/ns1:PurchaseOrder/ns1:PurchaseOrderHeader/ns1:OUAddressLine1" /&gt; &lt;!-- dtto --&gt; &lt;xsl:value-of select="/POCollection/PurchaseOrder/PurchaseOrderHeader/OUAddressLine1" /&gt; &lt;!-- dtto --&gt; &lt;xsl:value-of select="//OUAddressLine1" /&gt; </code></pre> <p>Edit: following should work</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:amw="http://www.amway.com/PurchaseOrder/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output method="text" /&gt; &lt;xsl:template match="/"&gt; &lt;xsl:value-of select="/amw:POCollection/amw:PurchaseOrder/amw:PurchaseOrderHeader/amw:OUAddressLine1" /&gt; &lt;xsl:text&gt;|&lt;/xsl:text&gt; &lt;xsl:value-of select="//amw:PurchaseOrder/amw:PurchaseOrderHeader/amw:OUAddressLine1" /&gt; &lt;xsl:text&gt;|&lt;/xsl:text&gt; &lt;xsl:value-of select="/amw:POCollection/amw:PurchaseOrder/amw:PurchaseOrderHeader/amw:OUAddressLine1" /&gt; &lt;xsl:text&gt;|&lt;/xsl:text&gt; &lt;xsl:value-of select="//amw:OUAddressLine1" /&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&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