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

namespace-uri

namespace-uri

The namespace-uri function in XQuery returns the namespace URI of the expanded QName of the provided node. It helps retrieve the namespace part associated with elements or attributes.

Syntax

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

Return Value

  • Returns the
    xs:anyURI
    representing the namespace URI of the node’s QName.
  • Returns the empty string
    ""
    if the node has no namespace.
  • Returns an empty sequence if the input is empty.
  • Raises an error if no argument is provided and the context item is absent or not a node.

Examples

The following table lists some sample values and return values:
SAMPLE FUNCTION
OUTPUT
fn:namespace-uri(<a:book xmlns:a="http://example.com"/>)
"http://example.com"
fn:namespace-uri(document{<root/>})
""
fn:namespace-uri(text{"Hello"})
""
fn:namespace-uri(())
""

Additional information

  • Works with element, attribute, and processing instruction nodes.
  • Returns the namespace URI even if a prefix is not explicitly present.
  • It is useful for namespace-aware XML processing.

0 COMMENTS

We’d like to hear from you!