### Saxon.Api

- BinaryResource
- CatalogCollection
- DirectoryCollection
- DocumentBuilder
- DomDestination
- DynamicContext
- DynamicError
- EmptyEnumerator<T>
- ErrorReporter
- ErrorReporterToStaticError
- ErrorReporterWrapper
- ExtensionFunction
- ExtensionFunctionCall
- ExtensionFunctionDefinition
- Feature<T>
- FeatureKeys
- HostLanguage
- ICollectionFinder
- IErrorReporter
- IInvalidityHandler
- IMessageListener
- IMessageListener2
- InvalidityHandlerWrapper
- IPredicate<in XdmItem>
- IQueryResolver
- IResource
- IResourceCollection
- IResourceFactory
- IResultDocumentHandler
- IXmlLocation
- JarCollection
- NamespaceConstant
- NullDestination
- Predicate<T>
- Predicates
- Processor
- QName
- RawDestination
- RecoveryPolicy
- Resource
- ResourceCollection
- SchemaManager
- SchemaResolver
- SchemaValidationMode
- SchemaValidator
- Serializer
- StandardCollectionFinder
- StandardLogger
- StaticContext
- StaticError
- Step<TInput, TResult>
- Steps
- TextWriterDestination
- TreeModel
- URIQueryParameters
- ValidationFailure
- WhitespacePolicy
- XdmAnyArrayType
- XdmAnyFunctionType
- XdmAnyItemType
- XdmAnyMapType
- XdmAnyNodeType
- XdmArray
- XdmAtomicType
- XdmAtomicValue
- XdmAxis
- XdmDestination
  - - TreeProtector
- XdmEmptySequence
- XdmExternalObjectValue
- XdmFunctionItem
- XdmItem
- XdmItemType
- XdmMap
- XdmNode
- XdmNodeKind
- XdmSequenceType
- XdmValue
- XmlDestination
- XmlProcessingError
- XmlResource
- XPathCompiler
- XPathExecutable
- XPathSelector
- XQueryCompiler
- XQueryEvaluator
- XQueryExecutable
- Xslt30Transformer
- XsltCompiler
- XsltExecutable
  - - ParameterDetails
- XsltPackage
- XsltTransformer

### Saxon.Api

# Interface IResource

All Known Implementing Classes
  Resource

public interface IResource

This interface defines a Resource. The Resource objects belong to a collection. It is used to support the fn:collection() and fn:uri-collection() functions.

It is recommended (but is not universally the case) that fetching (and where necessary parsing) the content of a Resource should be delayed until the `getItem` method is called. This means that errors in fetching the resource or parsing its contents may go undetected until the resource is materialized in this way.

### 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.

## 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.