commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Copeland <...@infoether.com>
Subject Re: Does Jelly support CDATA blocks?
Date Thu, 15 May 2003 14:58:45 GMT
> But why would you want to keep them ?

Having the code in a CDATA block makes it look like this:

http://pmd.sourceforge.net/rules/basic.html

i.e., all nice and spread out and such.  If it's just in a <source>
element it gets all crammed together on the same line.

> It is normal XML to consider the CDATA section as simple text. The only 
> practical restriction is when re-toutputting the document: then if you put
> <![CDATA[ $node.get("./example").value() < 3 ]]>
> It should become (without CDATA):
> $node.get("./example").value() &lt; 3

Yup, that's exactly what's happening :-(

> PS: note that it is often an error that people use CDATA sections hoping 
> they stay along an xml-pipeline. Most XML-parsing APIs however, don't 
> offer that (for example SAX doesn't, and Jelly is based on SAX, only an 
> extension thereof (the LexicalHandler)).

Guilty :-)

I guess what I'm looking for is to end up with this:

=================
<pre>
  // this is bad
  public void bar() {
      try {
          int x=2;
      } finally {
      }
  }                  
</pre>
=================

in my HTML.  Is there another way to do this?

Thanks much,

Tom



Mime
View raw message