Class XSLTOperation
- java.lang.Object
-
- ro.sync.ecss.extensions.commons.operations.TransformOperation
-
- ro.sync.ecss.extensions.commons.operations.XSLTOperation
-
- All Implemented Interfaces:
AuthorOperation
,Extension
@API(type=INTERNAL, src=PUBLIC) public class XSLTOperation extends TransformOperation
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 Constructor Description XSLTOperation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canTreatAsScript(java.lang.String script)
protected javax.xml.transform.Transformer
createTransformer(AuthorAccess authorAccess, javax.xml.transform.Source scriptSrc)
Creates a Transformer from a given script.protected javax.xml.transform.Transformer
createTransformer(AuthorAccess authorAccess, javax.xml.transform.Source xslSrc, ro.sync.ecss.extensions.commons.operations.ElementLocationPath currentElementLocation)
Create an XSLT transformer.java.lang.String
getDescription()
-
Methods inherited from class ro.sync.ecss.extensions.commons.operations.TransformOperation
doOperation, getArguments
-
-
-
-
Method Detail
-
createTransformer
protected javax.xml.transform.Transformer createTransformer(AuthorAccess authorAccess, javax.xml.transform.Source xslSrc, ro.sync.ecss.extensions.commons.operations.ElementLocationPath currentElementLocation) throws javax.xml.transform.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:
javax.xml.transform.TransformerConfigurationException
-
createTransformer
protected javax.xml.transform.Transformer createTransformer(AuthorAccess authorAccess, javax.xml.transform.Source scriptSrc) throws javax.xml.transform.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:
javax.xml.transform.TransformerConfigurationException
- See Also:
TransformOperation.createTransformer(ro.sync.ecss.extensions.api.AuthorAccess, javax.xml.transform.Source)
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceExtension
- Overrides:
getDescription
in classTransformOperation
- Returns:
- The description of the extension.
- See Also:
Extension.getDescription()
-
canTreatAsScript
protected boolean canTreatAsScript(java.lang.String script)
- 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:
TransformOperation.canTreatAsScript(java.lang.String)
-
-