Package net.sf.saxon.lib
Class ResourceRequest
java.lang.Object
net.sf.saxon.lib.ResourceRequest
A bundle of information made available when requesting resource resolution.
Any of these properties may be absent.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringThe base URI that was used to resolve any relative URI, if known.static final Stringstatic final StringThe name of the requested resource, used when resolving entity referencesstatic final StringTheNatureof the resource, as defined in the RDDL specifications (based on theroleattribute in XLink).The public ID of the requested resource, where applicableThePurposeof the request, as defined in the RDDL specifications (based on thearcroleattribute in XLink).The relative URI that was actually requested, where applicable.If the encoding is specified out of band, it can be provided here.static final StringbooleanThis boolean flag is set to true when the URI identifies a document where streamed processing is required.static final StringThe URI to be dereferenced.booleanThis boolean flag is set to true when the URI takes the form of a namespace URI (rather than a location hint).static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Make a copy of a resource request (so that it can be modified without changing the original)resolve(ResourceResolver... resolvers) Resolve the request by passing it to one or more resource resolvers.
-
Field Details
-
TEXT_NATURE
- See Also:
-
BINARY_NATURE
- See Also:
-
XQUERY_NATURE
- See Also:
-
XSLT_NATURE
- See Also:
-
XSD_NATURE
- See Also:
-
XML_NATURE
- See Also:
-
DTD_NATURE
- See Also:
-
EXTERNAL_ENTITY_NATURE
- See Also:
-
ANY_PURPOSE
-
SCHEMA_NATURE
- See Also:
-
VALIDATION_PURPOSE
- See Also:
-
ANY_NATURE
-
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. -
baseUri
The base URI that was used to resolve any relative URI, if known. -
relativeUri
The relative URI that was actually requested, where applicable. -
publicId
The public ID of the requested resource, where applicable -
entityName
The name of the requested resource, used when resolving entity references -
nature
TheNatureof the resource, as defined in the RDDL specifications (based on theroleattribute in XLink). Some of the allowed values are provided as constants, for exampleTEXT_NATURE,XSLT_NATURE,XQUERY_NATURE. -
purpose
ThePurposeof the request, as defined in the RDDL specifications (based on thearcroleattribute in XLink). -
uriIsNamespace
public boolean uriIsNamespaceThis 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 animport moduledeclaration in XQuery when only the module namespace is known, and when resolving anxsl:import, or an XML Schema import in XSLT or XQuery, if only the target namespace of the required schema document is known. -
streamable
public boolean streamableThis boolean flag is set to true when the URI identifies a document where streamed processing is required. In this case the result must be a StreamSource or SAXSource -
requestedEncoding
If the encoding is specified out of band, it can be provided here. Requesting an encoding doesn't gaurantee that it'll be used. For example, HTTP headers might override it.
-
-
Constructor Details
-
ResourceRequest
public ResourceRequest()
-
-
Method Details
-
copy
Make a copy of a resource request (so that it can be modified without changing the original)- Returns:
- a copy of the request
-
resolve
Resolve the request by passing it to one or more resource resolvers. The resolvers are tried in turn until one of them returns a non-null result; if the final result is null, this method returns null- Parameters:
resolvers- the resource resolvers to be used- Returns:
- the result from the first resolver that returns a non-null result; or null if none of them does so.
- Throws:
XPathException
-