Bug 44635

Summary: XSLT split one CDATA block into several
Product: Ant Reporter: Vitia <vitia>
Component: Core tasksAssignee: Ant Notifications List <notifications>
Status: RESOLVED INVALID    
Severity: major Keywords: XSLTBug
Priority: P3    
Version: 1.6.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Vitia 2008-03-19 09:36:14 UTC
Hello.
I have a problem with simple xslt transformation.

<?xml version="1.0" encoding="windows-1251"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" encoding="UTF-8" indent="no" omit-xml-declaration="no" cdata-section-elements="string"/>
	<xsl:template match="*">
		<xsl:copy>
			<xsl:for-each select="@*">
				<xsl:copy/>
			</xsl:for-each>
			<xsl:apply-templates/>
		</xsl:copy>
	</xsl:template>
</xsl:stylesheet>

It's copy one xml-doc to another.
I try to copy the next document
<?xml version="1.0" encoding="UTF-8"?>
<property name="propertyComment">
	<string><![CDATA[leave blank for no input, "console" to read from the console window,
and any path to a file to read from that file]]></string>
</property>

And this is the ant-script, that i use:
<?xml version="1.0" encoding="windows-1251"?>
<project default="help" basedir=".">
    <target name="help">
	<xslt basedir="." destdir=".\1\"  style="test.xsl" force="true" in="test.xml" out="test.xml.new" processor="trax">
	</xslt>
    </target>
</project>

In the output dcument I have several CDATA instead of one in source document:
<?xml version="1.0" encoding="UTF-8"?>
<property name="propertyComment">
	<string><![CDATA[leave blank for no input, "con]]><![CDATA[sole" to read from the console w]]><![CDATA[indow,
and any path to a file to]]><![CDATA[ read from that file]]></string>
</property>


When I use Microsoft xslt processor it outputs only one CDATA block in this case.
Why trax output several CDATA blocks?
Can I fixed it?

All documents that i've mentioned are attached.

Best regards,
Victor
Comment 1 Peter Reilly 2008-03-22 07:44:01 UTC
This is an ant bugzilla site, not an xslt site.
please direct this request for infomration to the correct site.