xquery-functions-related-to-qnames-local-name-from-qname

xquery
#xquery#functions-related-to-qnames-local-name-from-qname
Syntax

          AdventureWorks2022
        

Returns an xs:NCNAME that represents the local part of QName specified by

$arg. The result is

an empty sequence if

$arg

is the empty sequence.

$arg

Is the QName that the local name should be extracted from.

This topic provides XQuery examples against XML instances that are stored in various

type

columns in the

database.

The following example uses the

function to retrieve the local name

and namespace URI parts from a QName type value. The example performs the following:

Creates an XML schema collection.

Creates a table with an xml type column. The xml type is typed using the XML schema

collection.

Stores a sample XML instance in the table. Using the

method of the xml data

type, the query expression is executed to retrieve the local name part of the QName type

value from the instance.

AdventureWorks2022 fn:local-name-from-QName($arg as xs:QName?) as xs:NCName?
DROP
TABLE
T go