Page 1 of 1

Diffences in Usage oXygen vs saxon @ commandline

Posted: Wed Jul 20, 2016 7:29 pm
by gerhardegger
Hi all,

The following works fine in oXygen (using Saxon 9), but does not work on the commandline!

I have a problem with writing into a zip-file - i.e. a Docx-File.

<xsl:param name="template"/>
....
<xsl:variable name="filename"><xsl:text>zip:file:</xsl:text><xsl:value-of select="$template"/><xsl:text>!word/document.xml</xsl:text></xsl:variable>
.....
<xsl:result-document href="{$filename}">
<xsl:copy-of select="$content"/>
</xsl:result-document>


On the commandline I use: java -jar saxon9ee.jar testfile.xml xml2docx.xsl template=/Users/gerhard/xml2docx/Template.docx

Here is the error I get:

Error at xsl:result-document on line 261 of xml2docx.xsl:
Resolved URL is malformed: unknown protocol: zip
Resolved URL is malformed


What's wrong?


Thank you all for your replies :-)


Gerhard

Re: Diffences in Usage oXygen vs saxon @ commandline

Posted: Thu Jul 21, 2016 12:36 pm
by adrian
Hello,

You are using "zip:file:" which is an Oxygen specific protocol. This means it cannot possibly work outside of Oxygen.
Furthermore you are using "zip:file:" for writing (xsl:result-document) for which there is no workaround outside of Oxygen. For read-only access to files within ZIP archives you could use "jar:file:", which is supported by Java.

Regards,
Adrian

Re: Diffences in Usage oXygen vs saxon @ commandline

Posted: Thu Jul 21, 2016 3:42 pm
by gerhardegger
Oh ... I see :(

Anyway: Thanks for your reply!!

Best Regards, Gerhard