Package net.sf.saxon.serialize
Class SerializationProperties
java.lang.Object
net.sf.saxon.serialize.SerializationProperties
Define a set of serialization properties. These may contain simple output properties such as
method
or indent, Saxon extensions such as saxon:indent-spaces, and may also contain an index
of character maps.-
Constructor Summary
ConstructorsConstructorDescriptionCreate a set of defaulted serialization parametersCreate a set of serialization parameters based on defined output properties, with no character mapsSerializationProperties(Properties props, CharacterMapIndex charMapIndex) Create a set of serialization parameters based on defined output properties, with an index of named character maps that may be referred to from theUSE_CHARACTER_MAPSproperty -
Method Summary
Modifier and TypeMethodDescriptioncombineWith(SerializationProperties defaults) Combine these serialization parameters with a set of default serialization parameters to create a new set of serialization parameters.Get the character map index, if anyGet the simple output properties defined in these serialization parameters.getProperty(String name) Get the value of a serialization propertyGet any validation factory that was added to the serialization parameters usingsetValidationFactory(FilterFactory)Convenience method to create an appropriate SequenceNormalizer, based on the item-separator appearing in the serialization parameters.voidsetProperty(String name, String value) Set the value of a serialization property.voidsetValidationFactory(FilterFactory validationFactory) Although validation is not normally part of serialization, thexsl:result-documentinstruction allows a validator to be inserted into the serialization pipeline.toString()
-
Constructor Details
-
SerializationProperties
public SerializationProperties()Create a set of defaulted serialization parameters -
SerializationProperties
Create a set of serialization parameters based on defined output properties, with no character maps- Parameters:
props- the output properties
-
SerializationProperties
Create a set of serialization parameters based on defined output properties, with an index of named character maps that may be referred to from theUSE_CHARACTER_MAPSproperty- Parameters:
props- the output propertiescharMapIndex- the index of named character maps
-
-
Method Details
-
setProperty
Set the value of a serialization property.- Parameters:
name- the property name in Clark notation (if this is constant, the available constants are defined in classesOutputKeysandSaxonOutputKeys).value- the property value. In the case of QName-valued properties, such ascdata-section-elements, these should be in Clark notation
-
getProperty
Get the value of a serialization property- Parameters:
name- the property name in Clark notation (if this is constant, the available constants are defined in classesOutputKeysandSaxonOutputKeys).- Returns:
- the property value. In the case of QName-valued properties, such as
cdata-section-elements, these should be in Clark notation
-
getProperties
Get the simple output properties defined in these serialization parameters. The property names will be in clark-name format, for example"indent"or"{http://saxon.sf.net/}indent-spaces"- Returns:
- the output properties
-
getCharacterMapIndex
Get the character map index, if any- Returns:
- the character map index, if one is present, otherwise null
-
setValidationFactory
Although validation is not normally part of serialization, thexsl:result-documentinstruction allows a validator to be inserted into the serialization pipeline. This is achieved by adding a request to insert a validation stage to the serialization parameters. The request is in the form of a factory function that constructs the required validator- Parameters:
validationFactory- a function that inserts a validator into aReceiverpipeline
-
getValidationFactory
Get any validation factory that was added to the serialization parameters usingsetValidationFactory(FilterFactory)- Returns:
- the validation factory, or null if there is none.
-
makeSequenceNormalizer
Convenience method to create an appropriate SequenceNormalizer, based on the item-separator appearing in the serialization parameters. If the serialization parameters include a request for validation, then a validator will also be inserted into the pipeline immediately after the SequenceNormalizer, as required by the rules forxsl:result-document.- Parameters:
next- the nextReceiver in the pipeline- Returns:
- the new
SequenceNormalizer, feeding into the suppliedReceiver, possibly via a new validating filter.
-
combineWith
Combine these serialization parameters with a set of default serialization parameters to create a new set of serialization parameters. Neither of the input parameter sets is modified- Parameters:
defaults- the parameters to use when no explicit values are supplied- Returns:
- the new set of serialization parameters
-
toString
-