You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by mo...@apache.org on 2003/09/15 22:35:01 UTC

cvs commit: jakarta-commons/jelly/xdocs faq.xml

morgand     2003/09/15 13:35:01

  Modified:    jelly/xdocs faq.xml
  Log:
  added info on CDATA sections
  
  Revision  Changes    Path
  1.9       +51 -0     jakarta-commons/jelly/xdocs/faq.xml
  
  Index: faq.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/xdocs/faq.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- faq.xml	23 Jun 2003 02:30:49 -0000	1.8
  +++ faq.xml	15 Sep 2003 20:35:01 -0000	1.9
  @@ -62,6 +62,11 @@
             How do I use expressions and tag attributes?
           </a>
         </li>
  +      <li>
  +        <a href="#cdata">
  +          How do Jelly scripts handle CDATA sections?
  +        </a>
  +      </li>
       </ol>
       <p><strong>Building Jelly</strong></p>
       <ol>
  @@ -296,6 +301,52 @@
   }</pre>
   </code>
           </dd>
  +      </dl>
  +            <dl>
  +        <dt>
  +          <a name="cdata">
  +            How do Jelly scripts handle CDATA sections?
  +          </a>
  +        </dt>
  +        <dd>
  +          Jelly outputs the <i>content</i> of a CDATA section directly.  You can use CDATA sections
  +          to create output that otherwise cannot be described in XML.  For example, you can use
  +          a CDATA section to create a DTD.  The following Jelly script:
  +        </dd>
  +                <dd>
  +<code>
  +<pre>
  +&lt;?xml version="1.0"?>
  +
  +&lt;j:file xmlns:j="jelly:core" var="foo" escapeText="false">
  +    
  +    &lt;![CDATA[
  +        &lt;!DOCTYPE foo [
  +            &lt;!ELEMENT foo (#PCDATA)>
  +        ]>
  +    ]]&gt;
  +    
  +    &lt;foo/>
  +    
  +&lt;/j:file>
  +</pre>
  +</code>
  +</dd>
  +<dd>
  +   will produce this output:
  +        </dd>
  +<dd>
  +<code>
  +<pre>
  +&lt;?xml version="1.0" encoding="UTF-8"?>
  +&lt;!DOCTYPE foo [
  +    &lt;!ELEMENT foo (#PCDATA)>
  +]>
  +
  +&lt;foo/>
  +</pre>
  +</code>
  +</dd>
         </dl>
       </section>
       <section name="Building Jelly">