On 11/29/2011 02:57 PM, Yves Forkl wrote:
> When using process command copyDocument to write the current document into a
> temporary file which will be fed to command "transform", image file paths (as
> contained e.g. in attribute fileref of the DocBook imagedata element) are
> changed. In my case, the directory part is dropped and replaced by "./",
> mutilating the file paths.
>
> Of course, when copying an XML file, it generally makes perfect sense to copy
> its resources (i.e. referenced images) as well, which XXE's copyDocument
> command is well designed to do:
> http://www.xmlmind.com/xmleditor/_distrib/doc/commands/copyDocument.html
>
> However, in my case, I am doing an in-place transform, so I neither need my
> images copied somewhere nor want to have the image paths touched at all.
>
> How do I need to use copyDocument so that it will leave my image paths
> unchanged?
>
May be you don't need to use copyDocument at all. For example, the
process command below:
---
<command name="mytransform">
<process showProgress="false">
<copyDocument to="TMP_in.xml" />
<transform stylesheet="mytransform.xsl"
version="2.0"
file="TMP_in.xml" to="TMP_out.xml" />
<read file="TMP_out.xml" encoding="UTF-8" />
</process>
</command>
---
could become:
---
<command name="mytransform">
<process showProgress="false">
<transform stylesheet="mytransform.xsl"
version="2.0"
file="%D" to="TMP_out.xml" />
<read file="TMP_out.xml" encoding="UTF-8" />
</process>
</command>
---
Information about variable "%D" found in
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/process_variables.html
Please do no forget to make sure that your document has been saved to
disk prior to executing the process command. This can be done by invoking:
---
<command name="XXE.save" parameter="[ifNeeded]" />
---
in the macro command calling the process command.
See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/XXE.save.html
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support