You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Keiron Liddle <ke...@aftexsw.com> on 2001/10/01 11:21:46 UTC

cdata text


Is there any particular reason that text inside CDATA sections is not
handled or ignored.

I removed the createCDATASection from the SAXDocumentFactory (so it just
creates a TextNode) and the text appeared. This probably is not the
solution, just a test to see what happens.
It seems that the bridge ignores the CDATASection class because the node
type is not an ELEMENT_NODE.

Do I need to remove the cdata sections (and replace "<" with "&lt;" etc.)
because this is the expected behaviour or is it not handling the cdata
properly.

Keiron

ps. I'm sending this again, the first one seems to have disappeared

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


Re: cdata text

Posted by Vincent Hardy <vi...@sun.com>.
Keiron,

Double checking the XML spec.:

+ <text> has a "mixed content" as defined in the XML spec. section 
  3.2.2. It means that a <text> element can contain both character
  data (PCDATA) and children elements.

+ Still in the XML spec. section 2.7 says that CDATA can appear 
  anywhere character data may occur. 

So this means that it is legal SVG to have a CDATA section in your
<text> element and we do have a bug as we do not support it.
Actually, if you look at the <style> or <script> elements, their
content model is character data (PCDATA) as well and the most common
use is with a CDATA section...

I am going to add a test case for this to the Batik test suite,
add a bug in Bugzilla and we will fix it.

Thanks,
Vincent.

Keiron Liddle wrote:
> 
> Is there any particular reason that text inside CDATA sections is not
> handled or ignored.
> 
> I removed the createCDATASection from the SAXDocumentFactory (so it just
> creates a TextNode) and the text appeared. This probably is not the
> solution, just a test to see what happens.
> It seems that the bridge ignores the CDATASection class because the node
> type is not an ELEMENT_NODE.
> 
> Do I need to remove the cdata sections (and replace "<" with "&lt;" etc.)
> because this is the expected behaviour or is it not handling the cdata
> properly.
> 
> Keiron
> 
> ps. I'm sending this again, the first one seems to have disappeared
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-dev-help@xml.apache.org

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


More on: Re: cdata text

Posted by Vincent Hardy <vi...@sun.com>.
Keiron,

I just commited a fix for the problem you reported and added a 
new sample which exercises that problem (samples/tests/textPCDATA.svg).
Thanks for your feedback!
Vincent.

Keiron Liddle wrote:
> 
> Is there any particular reason that text inside CDATA sections is not
> handled or ignored.
> 
> I removed the createCDATASection from the SAXDocumentFactory (so it just
> creates a TextNode) and the text appeared. This probably is not the
> solution, just a test to see what happens.
> It seems that the bridge ignores the CDATASection class because the node
> type is not an ELEMENT_NODE.
> 
> Do I need to remove the cdata sections (and replace "<" with "&lt;" etc.)
> because this is the expected behaviour or is it not handling the cdata
> properly.
> 
> Keiron
> 
> ps. I'm sending this again, the first one seems to have disappeared
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-dev-help@xml.apache.org

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