spurious cdata with rewrite and cdata-section
---------------------------------------------

         Key: XALANJ-2007
         URL: http://nagoya.apache.org/jira/browse/XALANJ-2007
     Project: XalanJ2
        Type: Bug
  Components: Xalan-CmdLine, Xalan-extensions  
    Versions: 2.6    
 Environment: Linux (2.6.9), Gentoo, blackdown-jdk-1.4.2.01
    Reporter: Matthieu Paindavoine
    Priority: Minor


Processing the following input xml file:

---- foo.xml -------------------------------

<?xml version="1.0" encoding="utf-8"?>
<files>
<file>
<id>100</id>
<content>
<![CDATA[This is a wonderful book, rich in details and the page is very 
crunchy]]>
</content>
</file>
<file>
<id>101</id>
<content>
<![CDATA[Another book by the author of another book who wrote other books]]>
</content>
</file>
</files>
-----------------------------------------------

using the following xsl

------- foo.xsl -------------------------------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:redirect="http://xml.apache.org/xalan/redirect"; 
        extension-element-prefixes="redirect">
        
<xsl:output method="xml" cdata-section-elements="profile"/>

<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="files/file">
<xsl:variable name="file.id" select="./id"/>
<xsl:variable name="file.name" select="concat($file.id, '.txt')"/>
<redirect:write select="$file.name">    
<profile>
<xsl:apply-templates select="content"/> 
</profile>      
</redirect:write>
</xsl:template>

<xsl:template match="content">
<xsl:value-of select="."/>
</xsl:template>

</xsl:stylesheet>

-------------------------------------------------------

I obtain 2 files (tha'ts good), with CDATA all over the place (that's bad)

------ 100.txt ----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<profile><![CDATA[This is a wonderf]]><![CDATA[ul book, rich in details and 
the]]><![CDATA[ page is very crunchy]]></profile>
--------------------------------------------------------

Am I doing something wrong, or is there a problem?

Please let me know


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to