Saxon.Api

 

 

Saxon.Api

Class Resource

Direct Known Subclasses
BinaryResource, XmlResource

public class Resource
implements IResource

Resource Wrapper class for a Java Resource object

Constructor Summary

Resource ()

Default constructor

Resource (net.sf.saxon.lib.Resource rc)

Constructor to wrap a Java Resource

 

Method Summary

 string GetContentType()

Get the media type (MIME type) of the resource if known

 string GetResourceURI()

Get a URI that identifies this resource

 XdmItem GetXdmItem(DynamicContext context)

Get an XDM Item holding the contents of this resource.

 

Constructor Detail

Resource

public Resource()

Default constructor

Resource

public Resource(net.sf.saxon.lib.Resource rc)

Constructor to wrap a Java Resource

Parameters:

rc - Java Resource object

Method Detail

GetContentType

public string GetContentType()

Get the media type (MIME type) of the resource if known

Returns:

the media type if known; otherwise null

GetResourceURI

public string GetResourceURI()

Get a URI that identifies this resource

Returns:

a URI identifying the resource

GetXdmItem

public XdmItem GetXdmItem(DynamicContext context)

Get an XDM Item holding the contents of this resource.

Parameters:

context - the XPath evaluation context

Returns:

an item holding the contents of the resource. The type of item will reflect the type of the resource: a document node for XML resources, a string for text resources, a map or array for JSON resources, a base64Binary value for binary resource.May also return null if the resource cannot be materialized and this is not to be treated as an error.