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

resolve-uri

resolve-uri

The resolve-uri function in XQuery resolves a given relative URI against a base URI, producing an absolute URI. If the first argument is already an absolute URI, it returns it directly. It is useful for combining relative paths with base locations.

Syntax

fn:resolve-uri(relative, base)
The following table describes the argument for this command:
Argument
Required/Optional
Description
relative
Required
The relative URI to be resolved. If absolute, it is returned unchanged.
base
Optional
The base URI against which to resolve the relative URI. If omitted, the base URI of the static context or empty sequence is used.

Return Value

  • Returns an absolute URI (
    xs:anyURI
    ) that results from resolving the relative URI against the base URI.
  • Returns
    empty sequence
    if the relative URI is an empty sequence.
  • Returns the relative URI as-is if it is already an absolute URI.
  • Returns
    empty sequence
    or errors if the resolution cannot be determined.

Examples

The following table lists some sample values and return values:
SAMPLE FUNCTION
OUTPUT
fn:resolve-uri("page.html", "http://example.com/folder/")
"http://example.com/folder/page.html"
fn:resolve-uri("", "http://example.com")
()
fn:resolve-uri("../image.png", "http://example.com/folder/page.html")
"http://example.com/image.png"

Additional information

  • If
    $base
    is omitted, the function uses the base URI of the static context where the function is invoked.
  • Useful for building full URIs in web or XML processing contexts.

0 COMMENTS

We’d like to hear from you!