You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Dominique Broeglin <br...@essi.fr> on 2000/01/26 18:02:12 UTC

Redirect

	Hello (again ;-)

	I'm trying to use the redirect feature in order to handle images.
	I'm creating an XML document in which I insert a CDATA section created
from a String (byte[], "ISO8859_1") string. It gives me exactly what I
want (as far as I can see). After that I apply this stylesheet :

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform"
                 xmlns:lxslt="http://xml.apache.org/xslt"
                
xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
                 extension-element-prefixes="redirect">
 
   <xsl:template match="/">
     <out>
	begin
     </out>
     <redirect:open file="test.jpg"/>
     <redirect:write file="test.jpg"><xsl:value-of
select="img"/></redirect:write>
     <redirect:close file="test.jpg"/>
   </xsl:template>
  
</xsl:stylesheet>

which produces :

[dom@nara LDAP]$ java org.apache.xalan.xslt.Process -IN test.xml -XSL
test.xsl
========= Parsing file:/home/dom/directory/test/LDAP/test.xsl ==========
Parse of file:/home/dom/directory/test/LDAP/test.xsl took 514
milliseconds
========= Parsing test.xml ==========
file:/home/dom/directory/test/LDAP/test.xml; Line 2; Column 16
XSL Error: Could not parse test.xml document!
XSLT: An invalid XML character (Unicode: 0x0) was found in the CDATA
section.
Xalan: was not successful.
XSLProcessor: done

Can someone help me on this topic ?

Thanks,

Dom
	

ps: the xml file looks like this :

<?xml version="1.0" encoding="ISO-8859-1"?>
<img><![CDATA[ .... ]]></img>