You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Matthieu Paindavoine (JIRA)" <xa...@xml.apache.org> on 2004/12/07 20:50:09 UTC

[jira] Created: (XALANJ-2007) spurious cdata with rewrite and cdata-section

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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org


[jira] Updated: (XALANJ-2007) spurious cdata with rewrite and cdata-section

Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XALANJ-2007?page=all ]

Brian Minchau updated XALANJ-2007:
----------------------------------

    Fix Version: 2.7

> spurious cdata with rewrite and cdata-section
> ---------------------------------------------
>
>          Key: XALANJ-2007
>          URL: http://issues.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
>      Fix For: 2.7

>
> 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://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Resolved: (XALANJ-2007) spurious cdata with rewrite and cdata-section

Posted by "Henry Zongaro (JIRA)" <xa...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XALANJ-2007?page=history ]
     
Henry Zongaro resolved XALANJ-2007:
-----------------------------------

    Resolution: Fixed

Interestingly enough, you're the second person to report this issue today.  This problem appears to have been fixed since Xalan-J 2.5.0. It could be that you are using an older version of Xalan-J without realizing. Please read this FAQ entry: [1]. 

If that doesn't resolve the problem for you, please reopen this bug report. 

[1] http://xml.apache.org/xalan-j/faq.html#faq-N100CC 


> 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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org