Saxon.Api

 

 

Saxon.Api

Class XdmDestination


public class XdmDestination
implements IDestination

An XdmDestination is a Destination in which an XdmNode is constructed to hold the output of a query or transformation: that is, a tree using Saxon's implementation of the XDM data model.

No data needs to be supplied to the XdmDestination object. The query or transformation populates an XmlNode, which may then be retrieved as the value of the XmlNode property.

An XdmDestination can be reused to hold the results of a second transformation only if the Reset method is first called to reset its state.

Constructor Summary

XdmDestination ()

Construct an XdmDestination

 

Property Summary

 Uri BaseUri

This property determines the base URI of the constructed nodes. If the BaseUri property of the XdmDestination is set before the destination is written to, then the constructed XdmNode will have this base URI. Setting this property after constructing the node has no effect.

 TreeModel TreeModel

The Tree Model implementation to be used for the constructed document. By default the TinyTree is used. The main reason for using the LinkedTree alternative is if updating is required (the TinyTree is not updateable).

 net.sf.saxon.s9api.Destination UnderlyingDestination

Get the underlying Saxon Destination object from the XdmDestination. This method is for internal use but is provided for the benefit of applications that need to mix use of the Saxon .NET API with direct use of the underlying objects and methods offered by the Java implementation.

 XdmNode XdmNode

After construction, retrieve the constructed document node.

 

Method Summary

 void Close ()

Close the destination, allowing resources to be released. Saxon calls this method when it has finished writing to the destination.

 Uri getDestinationBaseURI ()

Get the base URI of the resource being written to this destination

 void OnClose (Action action)

Define an action to be performed when writing to the Destination is complete.

 void Reset ()

Reset the state of the XdmDestination so that it can be used to hold the result of another query or transformation.

 void setDestinationBaseURI (Uri uri)

Set the base URI of the resource being written to this destination

 

Constructor Detail

XdmDestination

public XdmDestination()

Construct an XdmDestination

Property Detail

BaseUri

public Uri BaseUri {get; set; }

This property determines the base URI of the constructed nodes. If the BaseUri property of the XdmDestination is set before the destination is written to, then the constructed XdmNode will have this base URI. Setting this property after constructing the node has no effect.

If no base URI is set, nodes written to this destination will typically take their base URI from the location of the event that created the node. For a node written by a query or stylesheet, this will typically be the static base URI of the instruction that created the node. For a node written by a schema validator, it will typically be the base URI of the node being validated in the source document.

TreeModel

public TreeModel TreeModel {get; set; }

The Tree Model implementation to be used for the constructed document. By default the TinyTree is used. The main reason for using the LinkedTree alternative is if updating is required (the TinyTree is not updateable).

UnderlyingDestination

public net.sf.saxon.s9api.Destination UnderlyingDestination {get; }

Get the underlying Saxon Destination object from the XdmDestination. This method is for internal use but is provided for the benefit of applications that need to mix use of the Saxon .NET API with direct use of the underlying objects and methods offered by the Java implementation.

Value:

The underlying Destination object

XdmNode

public XdmNode XdmNode {get; }

After construction, retrieve the constructed document node.

The value of the property will be null if no data has been written to the XdmDestination, either because the process that writes to the destination has not yet been run, or because the process produced no output.

Method Detail

Close

public void Close()

Close the destination, allowing resources to be released. Saxon calls this method when it has finished writing to the destination.

getDestinationBaseURI

public Uri getDestinationBaseURI()

Get the base URI of the resource being written to this destination

Returns:

the base URI, or null if none is known

OnClose

public void OnClose(Action action)

Define an action to be performed when writing to the Destination is complete.

Parameters:

action - The action to be performed.

Reset

public void Reset()

Reset the state of the XdmDestination so that it can be used to hold the result of another query or transformation.

setDestinationBaseURI

public void setDestinationBaseURI(Uri uri)

Set the base URI of the resource being written to this destination

Parameters:

uri - the base URI to be used