Flylib.com

Books Software

 
 
 

escape-uri


escape-uri

The escape-uri() function applies the URI escaping conventions defined in RFC 2396 to an input string. For example, «escape-uri("my document.xml", true()) » returns the string «my%20document.xml ».

Argument

Data Type

Meaning

value

xs:string

The input string, to which URI escaping is to be applied

escape-reserved

xs:boolean

Set to true if characters with a reserved meaning in URIs (for example «/ » and «# ») are to be escaped

Result

xs:string

The URI in its escaped form, as a string.



exactly-one

The exactly-one() function returns its argument unchanged, provided that it is a sequence containing exactly one item. In other cases, it reports an error.

Argument

Data Type

Meaning

Value

item()*

The input value. Although the function signature says that any sequence of items is allowed, a runtime error will occur if the number of items is not exactly one

Result

item()

The same as the supplied value, after checking to ensure that it contains a single item



exists

The exists() function returns true if and only if a supplied sequence contains at least one item.

Argument

Data Type

Meaning

sequence

item()*

The input sequence

Result

xs:boolean

true if the input sequence is non-empty, otherwise false



expanded-QName

The expanded-QName() function returns a value of type xs:QName, given a namespace URI and a local name .

Argument

Data Type

Meaning

namespace

xs:string

The namespace URI part of the xs:QName, or a zero-length string to construct a QName that is in no namespace

local-name

xs:string

The local part of the xs:QName. This must conform to the XML rules for an NCName

Result

xs:QName

The newly constructed xs:QName



false

This function returns the boolean value false. There are no arguments.

 

Data Type

Meaning

Result

xs:boolean

The xs:boolean value false



floor

The floor() function returns the largest integer value that is less than or equal to the numeric value of the argument. The result has the same data type as the supplied value, for example if the supplied value is an xs:double then the result is returned as an xs:double .

For example, the expression «floor(11.3) » returns the decimal value 11 , while «floor(-11.3) » returns -12 .

Argument

Data Type

Meaning

value

Numeric

The supplied number

Result

Numeric

The result of rounding down the supplied number to the integer below. The result has the same primitive data type as the supplied value



hours-from-dayTimeDuration

This function extracts the hours component of a dayTimeDuration , as an integer. For example, if the supplied duration is «PT3 6H » , the result will be 12 .

Argument

Data Type

Meaning

input

xdt:yearMonthDuration

The value from which the hours component is to be extracted

Result

xs:integer

The number of hours in the duration, after normalizing it so that 60 minutes is represented as one hour and 24 hours is represented as one day. The value will be negative if the duration is negative



hours-from-time /dateTime

This entry covers two related functions: hours-from-dateTime() and hours-from-time() .

These functions extract the hour of the day from an xs:time or xs:dateTime value, as an integer in the range 0 to 23. The value that is returned is in the original (localized) timezone associated with the time or dateTime value.

Argument

Data Type

Meaning

input

xs:dateTime? or xs:time?

The value from which the hours component is to be extracted. The data type of the supplied argument must correspond to the data type implied by the function name

Result

xs: intege r

The hours component of the time