Note that there are some explanatory texts on larger screens.

plurals
  1. POFinding embedded namespace uri's
    primarykey
    data
    text
    <p>Given the following: <br/>You will note that embedded in this xml sample is an Organisation node with its' own namespace declared with xmlns=""</p> <p>This is declared like this rather than using a prefix. Is there any way of finding all the namespaces declared in an xml document using xpath?</p> <p>I have tried a few variations, unfortunately xmlns is not treated like any other attributes of a document (for obvious reasons) and I cannot find a way to get them out using xpath.</p> <p>//@* does not include them for instance.</p> <p>I need a list of all the xmlns attributes in the document.</p> <pre><code>&lt;rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"&gt; &lt;channel xmlns:media="http://search.yahoo.com/mrss"&gt; &lt;title&gt;Search Results Title&lt;/title&gt; &lt;link&gt;http://acme.co.za/searchResults&lt;/link&gt; &lt;description&gt;Search Results Descrption&lt;/description&gt; &lt;item&gt; &lt;guid isPermaLink="false"&gt;uuid:169d3229-3b99-4647-9791-492bbbf4c419/PGS0900.PDF&lt;/guid&gt; &lt;link&gt;link&lt;/link&gt; &lt;title&gt;Title&lt;/title&gt; &lt;description&gt;This page...&lt;/description&gt; &lt;media:thumbnail url="..." width="100" height="100"&gt;&lt;/media:thumbnail&gt; &lt;Organisation xmlns="http://acme.co.za/MYNAMESPACE" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;Name&gt;Volkswagen&lt;/Name&gt; &lt;Business&gt;Kraft-durch-Freude-Wagen&lt;/Business&gt; &lt;Type&gt;Public&lt;/Type&gt; &lt;RegistrationNumber&gt;5908213224080&lt;/RegistrationNumber&gt; &lt;/Organisation&gt; &lt;/item&gt; &lt;/channel&gt; &lt;/rss&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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