search-namespaces. Name spaces hash to search in

$document.search-namespaces

In order to use prefixes of name spaces
in xnode.select* methods one must define these prefixes in this hash.

Here
·keys-name space prefixes,  
·values-their URIs.  

Adding several prefixes
$xdoc[^xdoc::create{<?xml version="1.0"?>
<document xmlns:s="urn:special">
   <s:code
 xmlns:o="urn:other" o:attr="123">let's play hide-and-seek</s:code>
</document>
}]
^xdoc.search-namespaces.add[
   $.
s[urn:special]
   $.o[urn:other]
]
^xdoc.
selectString[string(//s:code[@o:attr=123])]

Adding one prefix
$xdoc.search-namespaces.s[urn:special]


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 21.11.2006