Problem with custom action in Author Mode
Posted: Fri Dec 11, 2015 2:19 am
HI there,
I have a project (xpr) file in which I'm defining some custom actions for Author Mode editing. In one of them, I'm trying to use the ro.sync.ecss.extensions.commons.operations.XSLTOperation operation to run some XSLT on a selected element. The XSLT script location is specified as:
${pd}/oxygen/xsl/toggle_italic.xsl
All the other variables are set to their defaults.
When I try to run the action from the menu with an element selected, I get this error:
Couldn't execute operation: 'ro.sync.ecss.extensions.commons.operations.XSLTOperation' for action: 'Test' because of: Cannot create a transformer from the provided script:
${pd}/oxygen/xsl/toggle_italic.xsl
Reason:E org.xml.sax.SAXParseException; systemId: file:/home/mholmes/WorkData/english/scancan2/svnrepo/scanning/vol01/hocr_orig/2015_12_07_10_38_33_002.hocr; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
F Content is not allowed in prolog. at line 1 and column 1
Both the XSLT and the source file are valid.
This is the complete XSLT:
Can anyone see what I've screwed up here?
All help appreciated,
Martin
I have a project (xpr) file in which I'm defining some custom actions for Author Mode editing. In one of them, I'm trying to use the ro.sync.ecss.extensions.commons.operations.XSLTOperation operation to run some XSLT on a selected element. The XSLT script location is specified as:
${pd}/oxygen/xsl/toggle_italic.xsl
All the other variables are set to their defaults.
When I try to run the action from the menu with an element selected, I get this error:
Couldn't execute operation: 'ro.sync.ecss.extensions.commons.operations.XSLTOperation' for action: 'Test' because of: Cannot create a transformer from the provided script:
${pd}/oxygen/xsl/toggle_italic.xsl
Reason:E org.xml.sax.SAXParseException; systemId: file:/home/mholmes/WorkData/english/scancan2/svnrepo/scanning/vol01/hocr_orig/2015_12_07_10_38_33_002.hocr; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
F Content is not allowed in prolog. at line 1 and column 1
Both the XSLT and the source file are valid.
This is the complete XSLT:
Code: Select all
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xpath-default-namespace="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/" exclude-result-prefixes="saxon">
<xsl:template match="/">
<xsl:choose>
<xsl:when test="descendant::em">
<xsl:apply-templates mode="removeEm"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="addEm"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="em" mode="removeEm">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()" mode="addEm">
<em><xsl:copy-of select="."/></em>
</xsl:template>
<!-- Copy everything else as-is. -->
<xsl:template match="@*|node()" priority="-1" mode="#all">
<xsl:copy copy-namespaces="no">
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
All help appreciated,
Martin