Saxon.Api

 

 

Saxon.Api

Class ResourceRequest


public class ResourceRequest

A bundle of information made available when requesting resource resolution using a ResourceResolver. Any of its properties may be absent.

Field Summary

 string TEXT_NATURE

TEXT_NATURE represents plain text resources (media type = "text/plain"), for example unparsed text files

 string XML_NATURE

XML_NATURE represents XML documents with no specific known vocabulary (for example, documents requested using the doc() function)

 string XQUERY_NATURE

XQUERY_NATURE represents XQuery modules (main modules or library modules)

 string XSD_NATURE

XSD_NATURE represents XSD schema documents

 string XSLT_NATURE

XSLT_NATURE represents XSLT stylesheet modules

 

Property Summary

 Uri BaseUri

The base URI that was used to resolve any relative URI, if known.

 Encoding Encoding

The encoding specified in the request, explicitly or implicitly. For example, this will be supplied for a call on fn:unparsed-text if an encoding argument was supplied; for fn:parse-json it will be set to UTF-8 unconditionally.

 string Nature

The Nature of the resource, as defined in the RDDL specifications (based on the role attribute in XLink). Some of the allowed values are provided as constants, for example TEXT_NATURE, XSLT_NATURE, XQUERY_NATURE.

 string Purpose

The Purpose of the request, as defined in the RDDL specifications (based on the arcrole attribute in XLink).

 string RelativeUri

The relative URI that was actually requested, where applicable.

 Uri Uri

The URI to be dereferenced. If the request was for a relative URI reference, this will be the absolute URI after resolving against the base URI if known; if no base URI is known, it will be the URI as requested.

 bool UriIsNamespace

This boolean flag is set to true when the URI takes the form of a namespace URI (rather than a location hint). Specifically, it is set when resolving an import module declaration in XQuery when only the module namespace is known, and when resolving an xsl:import, or an XML Schema import in XSLT or XQuery, if only the target namespace of the required schema document is known.

 

Field Detail

TEXT_NATURE

public string TEXT_NATURE

TEXT_NATURE represents plain text resources (media type = "text/plain"), for example unparsed text files

XML_NATURE

public string XML_NATURE

XML_NATURE represents XML documents with no specific known vocabulary (for example, documents requested using the doc() function)

XQUERY_NATURE

public string XQUERY_NATURE

XQUERY_NATURE represents XQuery modules (main modules or library modules)

XSD_NATURE

public string XSD_NATURE

XSD_NATURE represents XSD schema documents

XSLT_NATURE

public string XSLT_NATURE

XSLT_NATURE represents XSLT stylesheet modules

Property Detail

BaseUri

public Uri BaseUri {get; set; }

The base URI that was used to resolve any relative URI, if known.

Encoding

public Encoding Encoding {get; set; }

The encoding specified in the request, explicitly or implicitly. For example, this will be supplied for a call on fn:unparsed-text if an encoding argument was supplied; for fn:parse-json it will be set to UTF-8 unconditionally.

If a specific encoding is requested, the preferred format for the response is a TextResource containing a Reader or explicit string-valued Content. If no encoding is requested for a text resource, the preferred format is a TextResource containing a (binary) Stream: but a TextResource containing a Reader or Content is acceptable if the data is already in character form so that no decoding is needed.

Nature

public string Nature {get; set; }

The Nature of the resource, as defined in the RDDL specifications (based on the role attribute in XLink). Some of the allowed values are provided as constants, for example TEXT_NATURE, XSLT_NATURE, XQUERY_NATURE.

Purpose

public string Purpose {get; set; }

The Purpose of the request, as defined in the RDDL specifications (based on the arcrole attribute in XLink).

RelativeUri

public string RelativeUri {get; set; }

The relative URI that was actually requested, where applicable.

Uri

public Uri Uri {get; set; }

The URI to be dereferenced. If the request was for a relative URI reference, this will be the absolute URI after resolving against the base URI if known; if no base URI is known, it will be the URI as requested.

UriIsNamespace

public bool UriIsNamespace {get; set; }

This boolean flag is set to true when the URI takes the form of a namespace URI (rather than a location hint). Specifically, it is set when resolving an import module declaration in XQuery when only the module namespace is known, and when resolving an xsl:import, or an XML Schema import in XSLT or XQuery, if only the target namespace of the required schema document is known.