Extracts the local part of the QName from $QName-var.
A QName (qualified name) is made up of a namespace name and a local part. The namespace name is the URI associated with the prefix of a namespace declaration.
If the value of $QName-var is the empty sequence, the empty sequence is returned. The empty sequence is a sequence containing zero items (), which is similar to null in SQL.
If a QName is not passed into $QName-var, the following error is displayed in the mapper:
Error occurred while executing XQuery: Error loading the XQuery or XSLT for this method: Type error in function get-local-name-from-QName invocation: expected type [QName@http://www.w3.org/2001/XMLSchema]?, given type [string@http://www.w3.org/2001/XMLSchema]
xf:get-local-name-from-QName(xs:QName? $QName-var) —> xs:string?
xs:QName |
Represents the QName to extract from. |
Returns the a string which contains the local part of the QName from $QName-var.
The following XML document defines the namespace called xacme:
<?xml version='1.0'?> <mydoc xmlns:xacme="http://www.acme.com/foo"> <xacme:n/> </mydoc>
The preceding XML Document associates the namespace prefix xacme to the URI: http://www.acme.com/foo. The string xacme:n is qualified name for the URI/local name pair:("http://www.acme.com/foo", "n").
The following example query calls the get-local-name-from-QName function:
<qname_example> {xs:string(xf:get-local-name-from-QName(xf:expanded-QName("http://www.acme.com/foo", "n")))} </qname_example>
The preceding query generates the following result:
<qname_example>n</qname_example>
W3C get-local-name-from-QName function description.