cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si mei <sime...@yahoo.com>
Subject Question on xalan-java's Redirect extension
Date Mon, 13 Nov 2000 21:03:54 GMT
Hi,

when I use Xalan-Java's Redirect extension to create
multiple XML output files, the first XML output file
has two XML declaration. How can I fix it?

My input xml file: 
<?xml version="1.0"?>
<ROWSET>
  <ROW>
     <line>text 1</line>
  </ROW>

  <ROW>
     <line>text 2</line>
  </ROW>
</ROWSET>

My stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
               
xmlns:xalan="org.apache.xalan.xslt.extensions.Redirect"
                extension-element-prefixes="xalan"
                version="1.0">

<xsl:template match="ROWSET">

<xsl:for-each select="ROW">
  <xsl:variable name="file" select="concat('row',
position(), '.xml' )"/>

    <xalan:write select="$file">
       <xsl:copy-of select="."/>
    </xalan:write>
</xsl:for-each>

</xsl:template>
</xsl:stylesheet>

I use command: 
java org.apache.xalan.xslt.Process -IN inputfile.xml 
-XSL mystylesheet.xsl

My first output file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<ROW>
     <line>text 1</line>
  </ROW>


Thanks!

















__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/

Mime
View raw message