August 2001
Intermediate to advanced
480 pages
11h 16m
English
namespace-uri() Function — Returns the namespace URI of the first node in the argument node-set.
stringnamespace-uri(node-set?)
A node-set. If the node-set is omitted, the namespace-uri() function creates a node-set that has the context node as its only member.
The namespace URI of the first node in the argument node-set. If the argument node-set is empty, the first node has no namespace URI, or the first node has a namespace URI that is null, an empty string is returned. Be aware that the namespace-uri() function returns an empty string for all nodes other than element and attribute nodes.
XPath section 4.1, Node Set Functions.
Here is a stylesheet that uses the document() function to examine its own nodes and then invoke the namespace-uri() against each of them:
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:months="Lookup table for month names"> <months:name sequence="01">January</months:name> <months:name sequence="02">February</months:name> <months:name sequence="03">March</months:name> <months:name sequence="04">April</months:name> <months:name sequence="05">May</months:name> <months:name sequence="06">June</months:name> <months:name sequence="07">July</months:name> <months:name sequence="08">August</months:name> <months:name sequence="09">September</months:name> <months:name sequence="10">October</months:name> <months:name sequence="11">November</months:name> <months:name ...