Class XSLTOperation
java.lang.Object
ro.sync.ecss.extensions.commons.operations.TransformOperation
ro.sync.ecss.extensions.commons.operations.XSLTOperation
- All Implemented Interfaces:
AuthorOperation
,Extension
An implementation of an operation to apply an XSLT stylesheet on a element and replacing it with
the result of the XSLT transformation or inserting the result in the document.
-
Field Summary
Fields inherited from class ro.sync.ecss.extensions.commons.operations.TransformOperation
ACTION_AT_CARET, ACTION_INSERT_AFTER, ACTION_INSERT_AS_FIRST_CHILD, ACTION_INSERT_AS_LAST_CHILD, ACTION_INSERT_BEFORE, ACTION_REPLACE, ARGUMENT_SCRIPT, ARGUMENT_SCRIPT_PARAMETERS, CARET_POSITION_AFTER, CARET_POSITION_BEFORE, CARET_POSITION_EDITABLE, CARET_POSITION_END, CARET_POSITION_PRESERVE, CARET_POSITION_START, CURRENT_ELEMENT_LOCATION
Fields inherited from interface ro.sync.ecss.extensions.api.AuthorOperation
NAMESPACE_ARGUMENT, NAMESPACE_ARGUMENT_DESCRIPTOR, SCHEMA_AWARE_ARGUMENT, SCHEMA_AWARE_ARGUMENT_DESCRIPTOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canTreatAsScript
(String script) protected Transformer
createTransformer
(AuthorAccess authorAccess, Source scriptSrc) Creates a Transformer from a given script.protected Transformer
createTransformer
(AuthorAccess authorAccess, Source xslSrc, ro.sync.ecss.extensions.commons.operations.ElementLocationPath currentElementLocation) Create an XSLT transformer.Methods inherited from class ro.sync.ecss.extensions.commons.operations.TransformOperation
doOperation, getArguments
-
Constructor Details
-
XSLTOperation
public XSLTOperation()
-
-
Method Details
-
createTransformer
protected Transformer createTransformer(AuthorAccess authorAccess, Source xslSrc, ro.sync.ecss.extensions.commons.operations.ElementLocationPath currentElementLocation) throws TransformerConfigurationException Create an XSLT transformer.- Overrides:
createTransformer
in classTransformOperation
- Parameters:
authorAccess
- The Author Access.xslSrc
- The stylesheet sourcecurrentElementLocation
- The XPath location of the current element.- Returns:
- The transformer.
- Throws:
TransformerConfigurationException
-
createTransformer
protected Transformer createTransformer(AuthorAccess authorAccess, Source scriptSrc) throws TransformerConfigurationException Description copied from class:TransformOperation
Creates a Transformer from a given script.- Specified by:
createTransformer
in classTransformOperation
- Parameters:
authorAccess
- Access to different Author resources.scriptSrc
- The XSLT or XQuery script.- Returns:
- A JAXP Transformer that will perform the transformation defined in the given script.
- Throws:
TransformerConfigurationException
- See Also:
-
getDescription
- Specified by:
getDescription
in interfaceExtension
- Overrides:
getDescription
in classTransformOperation
- Returns:
- The description of the extension.
- See Also:
-
canTreatAsScript
- Overrides:
canTreatAsScript
in classTransformOperation
- Parameters:
script
- The value of the script parameter.- Returns:
true
if this is an actual script orfalse
if it isn't.- See Also:
-