This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: Missing CDATA sections
- From: Elliotte Rusty Harold <elharo at metalab dot unc dot edu>
- To: fyl2xp1 <vnhu38f93 at subdimension dot com>,docbook-apps <docbook-apps at lists dot oasis-open dot org>
- Date: Thu, 11 Jul 2002 11:17:18 -0400
- Subject: Re: DOCBOOK-APPS: Missing CDATA sections
- References: <000801c228e5$5abf6630$0f11bc93@htrtttt>
At 3:15 PM +0100 7/11/02, fyl2xp1 wrote:
If I process this file:
<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"c:/docbook/docbkx412/docbookx.dtd">
<article>
<sect1><title>Error Prone</title>
<![CDATA[
Im going to dissapear!
]]>
<para>
Yes that's right ladies and gentlemen, CDATA is gone!
</para>
</sect1>
</article>
Wild guess: it's a style sheet issue, but also an issue with your
code. I don't think that's valid. The sect1 element does not allow
mixed content. Thus it' not a huge surprise the stylesheet throws it
away.
Remember, CDATA sections are syntax sugar. They are *not* elements.
In this case, they are not substitutes for a para. I suspect if you
wrap a para around the CDATA section like this, everything will work:
<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"c:/docbook/docbkx412/docbookx.dtd">
<article>
<sect1><title>Error Prone</title>
<para>
<![CDATA[
Im going to dissapear!
]]>
</para>
<para>
Yes that's right ladies and gentlemen, CDATA is gone!
</para>
</sect1>
</article>
Debugging tip: when the stylesheets aren't giving you what you
expect, validate your documents and correct any errors you find. In
my experience this fixes about half of the problems I initially
attribute to the stylesheets.
--
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| XML in a Nutshell, 2nd Edition (O'Reilly, 2002) |
| http://www.cafeconleche.org/books/xian2/ |
| http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+