fn:prefix-from-QName( $arg as xs:QName? ) as xs:NCName?
Returns an xs:NCName
representing the prefix of $arg.
The empty sequence is returned if $arg is the empty sequence or
if the value of $arg contains no prefix.
Parameters | |
---|---|
arg | A qualified name. |
xquery version "1.0-ml"; declare namespace ex="http://www.example.com/example"; fn:prefix-from-QName( fn:QName("http://www.example.com/example", "person") ) => empty sequence, because the QName constructed by fn:QName does not have a prefix
let $qn := fn:QName("http://www.w3.org/XML/1998/namespace", "lang") return fn:prefix-from-QName(fn:node-name( attribute {$qn} {"en"})) => xml