![]() ![]() ![]() ![]() ![]() ![]() |
This chapter provides descriptions of the XQuery QName functions available in the mapper functionality of WebLogic Workshop. You use the mapper functionality to generate queries and to edit these queries to add invocations to these provided XQuery functions. To learn more,see Invoking Functions or Operators in a Query.
In addition to the XQuery functions and operators available in the mapper functionality, a larger set functions and operators is provided. You can manually add invocations to these functions and operators to queries in the Source View of the mapper functionality. For a list of these additional functions and operators, see the XQuery 1.0 and XPath 2.0 Functions and Operators - W3C Working Draft 16 August 2002 available from the W3C Web site at the following URL:
http://www.w3.org/TR/2002/WD-xquery-operators-20020816
This section lists the QName functions available from the mapper functionality:
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?
Returns the a string which contains the local part of the
QName from $QName-var
.
The following XML document defines the namespace called xacme
:
<mydoc xmlns:xacme="http://www.acme.com/foo">
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:
{xs:string(xf:get-local-name-from-QName(xf:expanded-QName("http://www.acme.com/foo", "n")))}
The preceding query generates the following result:
<qname_example>n</qname_example>
W3C get-local-name-from-QName function description.
Extracts the namespace URI 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-namespace-from-QName invocation:
expected type [QName@http://www.w3.org/2001/XMLSchema]?,
given type [string@http://www.w3.org/2001/XMLSchema]
xf:get-namespace-from-QName(xs:QName $QName-var)
—> xs:
anyURI?
Returns the URI (of data type
anyURI) of the namespace in $QName-var
.
The following XML document defines the namespace called xacme:
<mydoc xmlns:xacme="http://www.acme.com/foo">
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-namespace-from-QName function:
let $a := <mydoc xmlns:xacme="http://www.acme.com/foo"> <xacme:n/> </mydoc>
xf:get-namespace-from-QName(xf:node-name($a/*[1]))
The preceding query generates the following result:
<name>http://www.acme.com/foo</name>
W3C get-namespace-from-QName function description.
![]() ![]() ![]() |