This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Missing CDATA sections


Well since I was writing documentation about XML and SGML there was quite
a lot of sections involving DOCTYPE declarations and that sort of stuff
which
meant that CDATA was required really, I suppose I could have replaced every
occurance of > with > and every instance of ! with whatever the Unicode
reference was but I didn't do that to begin with so for now I have to live
with
the consequences, next time I think I will use the Unicode references.

Imagine if you were doing some documentation about something which had loads
of program code, some crazy ofuscated code that used loads of <!'s or
whatever
this is where CDATA would come in handy right?
----- Original Message -----
From: "Jeff Beal" <jeff.beal@ansys.com>
To: "'fyl2xp1'" <vnhu38f93@subdimension.com>; "docbook-apps"
<docbook-apps@lists.oasis-open.org>
Sent: Friday, July 12, 2002 1:51 PM
Subject: RE: DOCBOOK-APPS: Missing CDATA sections


> May I ask why?  I'd certainly agree with Elliotte on this point.  There is
> absolutely no difference between
>
> <![CDATA[ This is text ]]>
>
> and
>
> This is text.
>
> Also, there's no difference between
>
> <![CDATA[<xmltag attname="attvalue">blah</xmltag>]]>
>
> and
>
> &lt;xmltag attname="attvalue"&gt;blah&lt;/xmltag&gt;]]>
>
> as far as an XML parser is concerned, so it seems unnecessary to attempt
to
> maintain the distinction in either the XML source or in a transformation
> result.  If that difference is important, you'll have to come up with some
> way of tagging around the CDATA, for example:
>
> <phrase role="cdata><![CDATA[ This is text ]]></phrase>
>
> and inserting the CDATA tags back in manually.  Even this would be tricky
> and you'd have to play around with the "disable-output-escaping" attribute
> to get it to work.
>
> This might work:
>
> <xsl:template match="phrase[@role='cdata']" disable-output-escaping="yes">
>  &lt;![CDATA[
>   <xsl:apply-templates/>
>  ]]&gt;
> </xsl:template>
>
> -----Original Message-----
> From: fyl2xp1 [mailto:vnhu38f93@subdimension.com]
> Sent: Thursday, July 11, 2002 5:09 PM
> To: docbook-apps
> Subject: Re: DOCBOOK-APPS: Missing CDATA sections
>
>
> no there was, I needed to include CDATA sections!
> ----- Original Message -----
> From: "Elliotte Rusty Harold" <elharo@metalab.unc.edu>
> To: "fyl2xp1" <vnhu38f93@subdimension.com>; "docbook-apps"
> <docbook-apps@lists.oasis-open.org>
> Sent: Thursday, July 11, 2002 8:12 PM
> Subject: Re: DOCBOOK-APPS: Missing CDATA sections
>
>
> > At 7:42 PM +0100 7/11/02, fyl2xp1 wrote:
> > >That is because I am not referring to the HTML style-sheets,
> > >that was made quite clear in my original email.  It turns out
> > >that the XSLT spec states:
> > >
> > >"CDATA sections should not be used except for text nodes that
> > >the cdata-section-elements attribute explicitly specifies should
> > >be output using CDATA sections."
> >
> > So is your problem that the text did in fact show up but it was not
> > enclosed in the CDATA section? If so, you should never have expected
> > that it would be. CDATA sections are syntax sugar, nothing more.
> > Processes should not and in general do not depend on whether text is
> > enclosed in a CDATA section, escaped with character references, or
> > escaped with entity references. It's all the same thing. If so, then
> > there really wasn't a need to "go through re-inserting the CDATA
> > sections."
> >
> > --
> >
> > +-----------------------+------------------------+-------------------+
> > | 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/    |
> > +----------------------------------+---------------------------------+


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]