net.sf.saxon

Class AugmentedSource

public class AugmentedSource extends Object implements Source

This class wraps a JAXP Source object to provide an extended Source object that contains options indicating how the Source should be processed: for example, whether or not it should be validated against a schema. Other options that can be set include the SAX XMLReader to be used, and the choice of whether a source in the form of an existing tree should be copied or wrapped.
Method Summary
voidaddFilter(ProxyReceiver filter)
Add a filter to the list of filters to be applied to the raw input
SourcegetContainedSource()
Get the Source object wrapped by this AugmentedSource
intgetDTDValidation()
Get whether or not DTD validation of this source is required
ListgetFilters()
Get the list of filters to be applied to the input.
intgetSchemaValidation()
Get whether or not schema validation of this source is required
intgetStripSpace()
Get the space-stripping action to be applied to the source document
StringgetSystemId()
Get the System ID.
BooleangetWrapDocument()
Assuming that the contained Source is a node in a tree, determine whether a tree will be created as a view of this supplied tree, or as a copy.
XMLReadergetXMLReader()
booleanisLineNumbering()
Get whether line numbers are to be maintained in the constructed document
static AugmentedSourcemakeAugmentedSource(Source source)
Create an AugmentedSource that wraps a given Source object.
voidsetDTDValidationMode(int option)
Set whether or not schema validation of this source is required
voidsetLineNumbering(boolean lineNumbering)
Set whether line numbers are to be maintained in the constructed document
voidsetSchemaValidationMode(int option)
Set whether or not schema validation of this source is required
voidsetStripSpace(int stripAction)
Set the space-stripping action to be applied to the source document
voidsetSystemId(String id)
Set the System ID.
voidsetWrapDocument(Boolean wrap)
Assuming that the contained Source is a node in a tree, indicate whether a tree should be created as a view of this supplied tree, or as a copy.
voidsetXMLReader(XMLReader parser)
Set the SAX parser (XMLReader) to be used

Method Detail

addFilter

public void addFilter(ProxyReceiver filter)
Add a filter to the list of filters to be applied to the raw input

getContainedSource

public Source getContainedSource()
Get the Source object wrapped by this AugmentedSource

Returns: the contained Source object

getDTDValidation

public int getDTDValidation()
Get whether or not DTD validation of this source is required

Returns: the validation mode requested, or DEFAULT to use the default validation mode from the Configuration.

getFilters

public List getFilters()
Get the list of filters to be applied to the input. Returns null if there are no filters.

getSchemaValidation

public int getSchemaValidation()
Get whether or not schema validation of this source is required

Returns: the validation mode requested, or DEFAULT to use the default validation mode from the Configuration.

getStripSpace

public int getStripSpace()
Get the space-stripping action to be applied to the source document

Returns: one of net.sf.saxon.value.Whitespace.IGNORABLE, net.sf.saxon.value.Whitespace.ALL, or net.sf.saxon.value.Whitespace.NONE

getSystemId

public String getSystemId()
Get the System ID. This gets the System Id on the underlying Source object.

Returns: the System ID.

getWrapDocument

public Boolean getWrapDocument()
Assuming that the contained Source is a node in a tree, determine whether a tree will be created as a view of this supplied tree, or as a copy.

Returns: if true, the node in the supplied Source is wrapped, to create a view. If false, the node and its contained subtree is copied. If null, the system default is chosen.

getXMLReader

public XMLReader getXMLReader()

isLineNumbering

public boolean isLineNumbering()
Get whether line numbers are to be maintained in the constructed document

Returns: true if line numbers are maintained

makeAugmentedSource

public static AugmentedSource makeAugmentedSource(Source source)
Create an AugmentedSource that wraps a given Source object. If this is already an AugmentedSource, the original AugmentedSource is returned.

Parameters: source the Source object to be wrapped

setDTDValidationMode

public void setDTDValidationMode(int option)
Set whether or not schema validation of this source is required

Parameters: option one of STRICT, STRIP, DEFAULT

setLineNumbering

public void setLineNumbering(boolean lineNumbering)
Set whether line numbers are to be maintained in the constructed document

Parameters: lineNumbering

setSchemaValidationMode

public void setSchemaValidationMode(int option)
Set whether or not schema validation of this source is required

Parameters: option one of STRICT, LAX, STRIP, PRESERVE, DEFAULT

setStripSpace

public void setStripSpace(int stripAction)
Set the space-stripping action to be applied to the source document

Parameters: stripAction one of net.sf.saxon.value.Whitespace.IGNORABLE, net.sf.saxon.value.Whitespace.ALL, or net.sf.saxon.value.Whitespace.NONE

setSystemId

public void setSystemId(String id)
Set the System ID. This sets the System Id on the underlying Source object.

Parameters: id the System ID.

setWrapDocument

public void setWrapDocument(Boolean wrap)
Assuming that the contained Source is a node in a tree, indicate whether a tree should be created as a view of this supplied tree, or as a copy.

Parameters: wrap if true, the node in the supplied Source is wrapped, to create a view. If false, the node and its contained subtree is copied. If null, the system default is chosen.

setXMLReader

public void setXMLReader(XMLReader parser)
Set the SAX parser (XMLReader) to be used

Parameters: parser