Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>/*[local-name()='catalog'] </code></pre> <p>is a solution to your question. But why would you want to ignore namespaces? They have been introduced to express something, e.g. to distinguish different types of catalogs. With your query, you can now select the content of any catalog in the world, but I assume you can only handle books. What will happen if you get a catalog of screws or cars instead?</p> <p>The mentioned things about the prefix (xsi) is correct. If you remove the prefix, all elements are in that namespace (called default namespace then). But you can still deal with it.</p> <p>In your code, give the namespace a prefix anyway. It needn't even match the original prefix:</p> <pre><code>XML.setProperty('SelectionNamespaces', "xmlns:xyz='http://www.w3.org/2001/XMLSchema-instance'"); </code></pre> <p>The second thing is to adapt the XPath query. It must then be </p> <pre><code>/xyz:catalog </code></pre> <p>The original XML only declares the xsi namespace, but never makes use of it. In this case, you can remove it completely. If you want to use the namespace and you want it with prefixes, then rewrite your XML to</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;xsi:catalog xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&gt; &lt;xsi:book id="bk101"&gt; &lt;xsi:author&gt;Gambardella, Matthew&lt;/xsi:author&gt; &lt;xsi:title&gt;XML Developer's Guide&lt;/xsi:title&gt; &lt;xsi:genre&gt;Computer&lt;/xsi:genre&gt; &lt;xsi:price&gt;44.95&lt;/xsi:price&gt; &lt;xsi:publish_date&gt;2000-10-01&lt;/xsi:publish_date&gt; &lt;xsi:description&gt;An in-depth look at creating applications with XML.&lt;/xsi:description&gt; &lt;/xsi:book&gt; &lt;/xsi:catalog&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