cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent Comparet" <laur...@comparet.com>
Subject [C2.1-M1] problem with document() function
Date Tue, 27 May 2003 05:39:42 GMT
Hi!

I am having troubles using document() function with C2.1-M1

it seems that as soon as I use the document() function somewhere in the
xslt, the main source and other sources previously loaded are switched to
the source from the last document() call (See files and results below)

It also seems to influence the output encoding as well.

Everything is working fine with xalan command-line on the same files
(with xalan, xerces and xml-api from cocoon distribution copied in
$JAVA_HOME/jre/lib/ext)

Is this some caching bug or did I miss something ???

Thanks for your help.

Laurent.

=output from cocoon=================================
<?xml version="1.0" encoding="UTF-8"?>
<output>
   <from-document>
      <root xmlns="http://xyz.com/file3/">this is the content of
file3</root>
   </from-document>
   <from-main-source>
      <root xmlns="http://xyz.com/file3/">this is the content of
file3</root>
   </from-main-source>
</output>

=output from xalan command line=====================
<?xml version="1.0" encoding="iso-8859-1"?>
<output>
   <from-document>
      <root xmlns="http://xyz.com/file2/">this is the content of
file2</root>
   </from-document>
   <from-main-source>
      <root xmlns="http://xyz.com/file1/">this is the content of
file1</root>
   </from-main-source>
</output>

=document.xsl=======================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

   <xsl:output method="xml" version="1.0" encoding="iso-8859-1"
indent="yes"/>

   <xsl:variable name="doc" select="document('file2.xml')"/>
   <!--xsl:variable name="doc" select="'other stuff'"/-->
   <xsl:variable name="dummy" select="document('file3.xml')"/>

   <xsl:template match="/">
      <output>
         <from-document>
            <xsl:copy-of select="$doc"/>
         </from-document>
         <from-main-source>
            <xsl:apply-templates/>
         </from-main-source>
      </output>
   </xsl:template>

   <xsl:template match="*|@*|text()" priority="-1">
      <xsl:copy>
         <xsl:copy-of select="@*"/>
         <xsl:apply-templates/>
      </xsl:copy>
   </xsl:template>

</xsl:stylesheet>

=sitemap============================================
<map:match pattern="bug">
   <map:generate src="bug/file1.xml" type="file"/>
   <map:transform src="bug/document.xsl" type="xslt"/>
   <map:serialize type="xml"/>
</map:match>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message