xsl-list
[Top] [All Lists]

Re: [xsl] anyURI problem

2011-08-26 03:49:04
I can only say: works for me. I tried it on the Windows 7 cmd shell (with disgust):

java -cp c:/Programme/saxon/saxon9pe.jar net.sf.saxon.Transform -xsl:test.xsl -it:test

test.xsl looks like this:

-----------------------------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  version="2.0"
  >

  <xsl:template name="test">
<xsl:result-document href="file:///c:/temp/{encode-for-uri('[Content_Types].xml')}">
      <test/>
    </xsl:result-document>
  </xsl:template>

</xsl:stylesheet>
-----------------------------

> dir \temp
2011-08-26  10:44    <DIR>          .
2011-08-26  10:44    <DIR>          ..
2011-08-26  10:44                45 [Content_Types].xml

>type \temp\*xml
\temp\[Content_Types].xml

<?xml version="1.0" encoding="UTF-8"?><test/>

Gerrit

On 2011-08-26 10:33, Jan Pour wrote:
Hi,

I tried both ways of how to cope with [Content_Types].xml
file in xsl:result-document href attribute:

Try using the iri-to-uri() function to turn this into a valid URI.

Saxon is fussier than some other products about insisting that URIs are
valid.

Michael Kay
Saxonica

That didn’t work for me, but
href="{encode-for-uri('[Content_Types].xml')}"
did.

Or verbose
href="%5bContent_Types%5d.xml"

Gerrit

in Saxon 8 I was able to generate such file, but with versions 9.*
I was not successful. With encode-for-uri() function 0-length file was
generated with following error message:

java.net.URISyntaxException: Illegal character in path at index 21:
file:///C:/xslt/test/[Content_Types].xml

I tried Saxon versions: 9, 9.1 and 9.3he
Is there any other solution?

Thanks,
Jan

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>