Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Table of Contents

Search

  1. Preface
  2. Understanding Data Types and Field Properties
  3. Designing Processes
  4. Using and Displaying Data
  5. Designing Guides
  6. Designing Process Objects
  7. Designing Service Connectors
  8. Using App Connections
  9. System Services, Listeners and Connectors
  10. Designing Human Tasks

Design

Design

name

name

The name function in XQuery returns the QName value of the node as a string, representing the element or attribute name including its prefix, if any. It returns the string-form of the node's name.

Syntax

fn:name(arg)
The following table describes the argument for this command:
Argument
Required/Optional
Description
arg
Optional
The node whose name is to be returned. If omitted, the context item is used.

Return Value

  • Returns the name of a node, as an
    xs:string
    that is either the zero-length string, or has the lexical form of an
    xs:QName
    .
  • Returns a string representing the QName of the node, including namespace prefix if present.
  • Returns an empty string if the node has no name, for example, text nodes, or the input is empty.
  • Raises an error if no argument is provided and the context item is not a node.

Examples

The following table lists some sample values and return values:
SAMPLE FUNCTION
OUTPUT
fn:name(<a:book xmlns:a="http://example.com"/> )
"a:book"
fn:name(text{"Hello"})
""
fn:name(())
""
fn:name()
(with context node
<ex:item>
in scope)
"ex:item"

Additional information

  • The function works for element, attribute, processing-instruction, and namespace nodes.
  • For nodes without names, such as text, comment, the return is an empty string.
  • The prefix is included if present, unlike
    local-name()
    .

0 COMMENTS

We’d like to hear from you!