June 2008
Intermediate to advanced
986 pages
27h 8m
English
[2.0]
local-name-from-QName()
Given an xs:QName
value, returns its local name.
xs:NCName?local-name-from-QName(xs:QName?)
An xs:QName value.
The local name portion of the given QName. This is returned as an xs:NCName, or “noncolonized” name. If
the argument is the empty sequence, local-name-from-QName() returns the
empty sequence.
XQuery 1.0 and XPath 2.0 Functions and Operators section 11.2, “Operators and Functions Related to QNames.”
Here is a short stylesheet that uses local-name-from-QName():
<?xml version="1.0"?> <!-- local-name-from-qname.xsl --> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:text>
Tests of the local-name-from-QName() </xsl:text> <xsl:text>function:
</xsl:text> <xsl:variable name="testQName1" as="xs:QName" select="QName('http://www.authors.com', 'auth:author')"/> <xsl:text>
 QName('http://www.authors.com', </xsl:text> <xsl:text>'auth:author') = </xsl:text> <xsl:value-of select="$testQName1"/> <xsl:text>
 The local name associated with </xsl:text> <xsl:text>this QName: "</xsl:text> <xsl:value-of select="local-name-from-QName($testQName1)"/> <xsl:text>"</xsl:text> <xsl:variable name="testQName2" as="xs:QName" select="QName('', 'sonnet')"/> <xsl:text>

 QName('', 'sonnet') = </xsl:text> <xsl:value-of select="$testQName2"/> <xsl:text>
 The local name associated ...
Read now
Unlock full access