Modifier and Type | Field and Description |
---|---|
static ResourceFactory |
FACTORY |
Constructor and Description |
---|
XmlResource(Configuration config,
NodeInfo doc)
Create an XML resource using a specific node.
|
XmlResource(Configuration config,
javax.xml.transform.Source source,
ParseOptions options,
int onError)
Create an XML resource using a JAXP Source object
|
XmlResource(NodeInfo doc)
Create an XML resource using a specific node
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType()
Get the media type (MIME type) of the resource if known
|
Item |
getItem(XPathContext context)
Get an item representing the resource: in this case a document node for the XML document.
|
java.lang.String |
getResourceURI()
Get a URI that identifies this resource
|
public static final ResourceFactory FACTORY
public XmlResource(NodeInfo doc)
doc
- the node in question (usually but not necessarily a document node)public XmlResource(Configuration config, NodeInfo doc)
config
- the Saxon Configuration. This must be the configuration to which the node
belongs.doc
- the node in question (usually but not necessarily a document node)public XmlResource(Configuration config, javax.xml.transform.Source source, ParseOptions options, int onError)
config
- the Saxon Configurationsource
- the JAXP Source objectoptions
- options for parsing the XML if it needs to be parsedonError
- flag indicating what should happen on a parsing error: one of
URIQueryParameters.ON_ERROR_FAIL
, URIQueryParameters.ON_ERROR_WARNING
,
or URIQueryParameters.ON_ERROR_IGNORE
public java.lang.String getResourceURI()
Resource
getResourceURI
in interface Resource
public Item getItem(XPathContext context) throws XPathException
getItem
in interface Resource
context
- the XPath evaluation contextXPathException
- if (for example) XML parsing failspublic java.lang.String getContentType()
getContentType
in interface Resource
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.