Package net.sf.saxon.resource
Class XmlResource
java.lang.Object
net.sf.saxon.resource.XmlResource
- All Implemented Interfaces:
Resource
The class is an implementation of the generic Resource object (typically an item in a collection)
representing an XML document
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionXmlResource
(XPathContext context, NodeInfo doc) Create an XML resource using a specific node.XmlResource
(XPathContext context, AbstractResourceCollection.InputDetails details) XmlResource
(NodeInfo doc) Create an XML resource using a specific node -
Method Summary
Modifier and TypeMethodDescriptionGet the media type (MIME type) of the resource if knowngetItem()
Get an item representing the resource: in this case a document node for the XML document.Get a URI that identifies this resource
-
Field Details
-
FACTORY
-
-
Constructor Details
-
XmlResource
Create an XML resource using a specific node- Parameters:
doc
- the node in question (usually but not necessarily a document node)
-
XmlResource
Create an XML resource using a specific node. (Method retained for backwards compatibility).- Parameters:
context
- the Saxon evaluation context. This must belong to the configuration to which the node belongs.doc
- the node in question (usually but not necessarily a document node)
-
XmlResource
-
-
Method Details
-
getResourceURI
Description copied from interface:Resource
Get a URI that identifies this resource- Specified by:
getResourceURI
in interfaceResource
- Returns:
- a URI identifying this resource
-
getItem
Get an item representing the resource: in this case a document node for the XML document.- Specified by:
getItem
in interfaceResource
- Returns:
- the document; or null if there is an error and the error is to be ignored
- Throws:
XPathException
- if (for example) XML parsing fails
-
getContentType
Get the media type (MIME type) of the resource if known- Specified by:
getContentType
in interfaceResource
- Returns:
- the string "application/xml"
-