Package net.sf.saxon.lib
Class ResourceRequest
- java.lang.Object
-
- net.sf.saxon.lib.ResourceRequest
-
public class ResourceRequest extends java.lang.ObjectA bundle of information made available when requesting resource resolution. Any of these properties may be absent.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringANY_NATUREstatic java.lang.StringANY_PURPOSEjava.lang.StringbaseUriThe base URI that was used to resolve any relative URI, if known.static java.lang.StringBINARY_NATUREstatic java.lang.StringDTD_NATUREjava.lang.StringentityNameThe name of the requested resource, used when resolving entity referencesstatic java.lang.StringEXTERNAL_ENTITY_NATUREjava.lang.StringnatureTheNatureof the resource, as defined in the RDDL specifications (based on theroleattribute in XLink).java.lang.StringpublicIdThe public ID of the requested resource, where applicablejava.lang.StringpurposeThePurposeof the request, as defined in the RDDL specifications (based on thearcroleattribute in XLink).java.lang.StringrelativeUriThe relative URI that was actually requested, where applicable.static java.lang.StringSCHEMA_NATUREbooleanstreamableThis boolean flag is set to true when the URI identifies a document where streamed processing is required.static java.lang.StringTEXT_NATUREjava.lang.StringuriThe URI to be dereferenced.booleanuriIsNamespaceThis boolean flag is set to true when the URI takes the form of a namespace URI (rather than a location hint).static java.lang.StringVALIDATION_PURPOSEstatic java.lang.StringXML_NATUREstatic java.lang.StringXQUERY_NATUREstatic java.lang.StringXSD_NATUREstatic java.lang.StringXSLT_NATURE
-
Constructor Summary
Constructors Constructor Description ResourceRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceRequestcopy()Make a copy of a resource request (so that it can be modified without changing the original)javax.xml.transform.Sourceresolve(ResourceResolver... resolvers)Resolve the request by passing it to one or more resource resolvers.
-
-
-
Field Detail
-
TEXT_NATURE
public static final java.lang.String TEXT_NATURE
- See Also:
- Constant Field Values
-
BINARY_NATURE
public static final java.lang.String BINARY_NATURE
- See Also:
- Constant Field Values
-
XQUERY_NATURE
public static final java.lang.String XQUERY_NATURE
- See Also:
- Constant Field Values
-
XSLT_NATURE
public static final java.lang.String XSLT_NATURE
- See Also:
- Constant Field Values
-
XSD_NATURE
public static final java.lang.String XSD_NATURE
- See Also:
- Constant Field Values
-
XML_NATURE
public static final java.lang.String XML_NATURE
- See Also:
- Constant Field Values
-
DTD_NATURE
public static final java.lang.String DTD_NATURE
- See Also:
- Constant Field Values
-
EXTERNAL_ENTITY_NATURE
public static final java.lang.String EXTERNAL_ENTITY_NATURE
- See Also:
- Constant Field Values
-
ANY_PURPOSE
public static final java.lang.String ANY_PURPOSE
-
SCHEMA_NATURE
public static final java.lang.String SCHEMA_NATURE
- See Also:
- Constant Field Values
-
VALIDATION_PURPOSE
public static final java.lang.String VALIDATION_PURPOSE
- See Also:
- Constant Field Values
-
ANY_NATURE
public static final java.lang.String ANY_NATURE
-
uri
public java.lang.String 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
public java.lang.String baseUri
The base URI that was used to resolve any relative URI, if known.
-
relativeUri
public java.lang.String relativeUri
The relative URI that was actually requested, where applicable.
-
publicId
public java.lang.String publicId
The public ID of the requested resource, where applicable
-
entityName
public java.lang.String entityName
The name of the requested resource, used when resolving entity references
-
nature
public java.lang.String 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
public java.lang.String purpose
ThePurposeof the request, as defined in the RDDL specifications (based on thearcroleattribute in XLink).
-
uriIsNamespace
public boolean 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 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 streamable
This 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
-
-
Method Detail
-
copy
public ResourceRequest 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
public javax.xml.transform.Source resolve(ResourceResolver... resolvers) throws XPathException
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
-
-