Problem to save a file to a remote server inside XML

Here should go questions about transforming XML with XSLT and FOP.
FJJCENT
Posts: 18
Joined: Sun Apr 22, 2018 10:17 pm

Problem to save a file to a remote server inside XML

Post by FJJCENT » Wed Apr 03, 2019 12:19 pm

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

adrian
Posts: 2531
Joined: Tue May 17, 2005 4:01 pm

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

Post by adrian » Wed Apr 03, 2019 1:36 pm

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Radu
Posts: 6275
Joined: Fri Jul 09, 2004 5:18 pm

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

Post by Radu » Wed Apr 03, 2019 1:48 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

FJJCENT
Posts: 18
Joined: Sun Apr 22, 2018 10:17 pm

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

Post by FJJCENT » Wed Apr 03, 2019 6:09 pm

Thanks to everybody, yes with four slash (file:////...) it works, you solved my problem and I can follow with my proyect.

Again Thanks
Francisco

Post Reply