On 07/24/2014 08:15 AM, Jeff Hooker wrote:
I’m trying to write a process command to produce a few .h files from a
single XML file. The command itself is very simple:
<commandname="dita.toFirmwareHeader">
<process>
<copyDocumentto="__doc.xml">
<resourcesmatch="^[a-zA-Z][a-zA-Z0-9.+-]*:/.+"/>
</copyDocument>
<transformstylesheet="xsl/pmc_custom/firmware/generate_firmwareheaderfile.xsl"file="__doc.xml"to="__doc.h"/>
<uploadbase="%0">
<copyFilefile="__doc.h"to="%0"/>
</upload>
</process>
</command>
<commandname="dita.convertToFirmwareHeader">
<macro>
<sequence>
<commandname="XXE.save"parameter="[checkIsSaved]"/>
<commandname="selectConvertedFile"
parameter="saveDirectoryURL"/>
<commandname="dita.toFirmwareHeader"parameter='"%_"'/>
<commandname="preview"parameter="[lastConverted]"/>
</sequence>
</macro>
</command>
The stylesheet is defined as a version 2.0 stylesheet, and page 19 of
the Configure.pdf manual for my version states that “Child element
transform in XMLmind XML Editor - Commands invokes the XSLT engine
(Saxon 6.5 or Saxon 9 depending on the version of the XSLT stylesheet)”,
yet this is the message that I get when I try to run the command:
Fatal error: Unknown XSLT element: result-document; SystemID:
file:/C:/Users/hookerje/AppData/Roaming/XMLmind/XMLEditor5/addon/pmc_dita-2/xsl/pmc_custom/firmware/generate_firmwareheaderfile.xsl;
Line#: 26; Column#: -1
Result-document is a 2.0 feature that has been in Saxon since 9.2. I’ve
replaced the version of saxon9 in XMLmind with my own version to make
sure that it is compatible, but it makes no difference. Do you have any
suggestions about what could be the issue?
XXE cannot guess that generate_firmwareheaderfile.xsl is an XSLT 2.0.
(No, it does not open the .xsl file to detect that.) You must specify
that using the "version" attribute. Example:
<transform version="2.0"
stylesheet="xsl/pmc_custom/firmware/generate_firmwareheaderfile.xsl"
file="__doc.xml" to="__doc.h" />
See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/transform.html
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support