Page 1 of 1

Problem to save a file to a remote server inside XML

Posted: Wed Apr 03, 2019 12:19 pm
by FJJCENT
Hallo everybody, I'm having a problem tryng to generate a file with XSLT and saving later to a remote resource, in te line 127 referenced as error the content is
<xsl:result-document href="{$url-guardado}">
and the variable $url-guardado contains -->file://Srv1/share1$/TEST/Worker/TEST/share_test/dir.xml

The Uri start by file:// and not by file:/// because the resource is remote (//) and not local (///)


try to save in : file://Srv1/share1$/TEST/Worker/TEST/share_test/dir.xml
Error at xsl:result-document on line 127 of directas.xsl: Invalid URI syntax: URI has an authority component

could you please tell me if is there any restriction with XSLT for remoting access and also how to avoid it.

Best Regards

Re: Problem to save a file to a remote server inside XML

Posted: Wed Apr 03, 2019 1:36 pm
by adrian
Hi,

URIs to UNC paths (\\ServerName\ShareName\) can be problematic. They usually depend on how the XSLT engine attempts to resolve them.
For Saxon and Oxygen it works with file:////ServerName/ShareName/path/to/file. So, use 4 forward slashes for UNC paths.

Regards,
Adrian

Re: Problem to save a file to a remote server inside XML

Posted: Wed Apr 03, 2019 1:48 pm
by Radu
Hi,

Also what Oxygen version are you using?
Using a very simple XSLT stylesheet from Oxygen 21 with Saxon 9 I cannot reproduce the problem when using two slashes:

Code: Select all

<xsl:stylesheet version="2.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:p="http://www.oxygenxml.com/ns/samples/personal"
exclude-result-prefixes="p">
<xsl:template match="/">
<xsl:result-document href="file://Srv1/share1$/TEST/Worker/TEST/share_test/dir.xml">
<a/>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>
Using a similar path with two slashes after the "file:" on my side seems to allow the XSLT processor to save to that file.

Regards,
Radu

Re: Problem to save a file to a remote server inside XML

Posted: Wed Apr 03, 2019 6:09 pm
by FJJCENT
Thanks to everybody, yes with four slash (file:////...) it works, you solved my problem and I can follow with my proyect.

Again Thanks
Francisco