Benoit Maisonny wrote:
> 
> I am using a transform command with the following parameters:
> file: %P%Sa.xml
> stylesheet: x.xslt
> to: %P%Sb.xml
> 
> The goal is to have b.xml generated from a.xml, both these files being
> in the same directory as the currently open file.
> 
> This works fine when %P resolves to a local directory on my hard drive.
> But, when the currently open file is on a WebDAV repository, my command
> fails miserably: XXE is looking for /a.xml as the source file instead of
> http://host:8080/long/path/a.xml.
> 
> I tried with %p just for fun but it doesn't work either (it's resolving
> to a local temporary directory that I guess is used by XXE to cache the
> WebDAV access).

No, not at all. See below.

> I suppose I must be missing something from the doc about macro variables
> or transform? Any help would be very appreciated.
> 

Transformations always take place in a temporary directory called
xxeZZZZ (ZZZZ is a random number), no matter where is stored the
document being edited.

The outline of the process command is therefore:

<process>
  <copyProcessResources resources="%p/a.xml" to="a.xml" />

  <transform stylesheet="x.xslt"
             file="a.xml" to="b.xml" />

  <upload to="%p/">
    <copyFile from="b.xml" to="b.xml" />
  </upload>
</process>

Notes:

* First line copies source file a.xml to the temporary xxeZZZZ directory.

* Second line transforms the a.xml copy to a temporary b.xml.

Note that in <transform stylesheet="x.xslt"/>, "x.xslt" is relative to
the configuration file containing the process command, and not to the
xxeZZZ directory.

* Third line uploads the generated b.xml to the directory containing the
document being edited.

References:

http://www.xmlmind.com/xmleditor/_distrib/doc/commands/copyProcessResources.html
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/transform.html
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/upload.html
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/process_variables.html



---
PS: I've not tested all this but I don't see why it wouldn't work, even
when %p point to the URL of a WebDAV directory.

---
PS2: OK, I admit that finding all this (e.g. the copyProcessResources
trick) is not obvious.







Reply via email to