This is the mail archive of the xsl-list@mulberrytech.com mailing list .


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

Re: copying CData sections from the source to destination documents


R_KNOWLES wrote:
> >Does it matter whether the output uses character references or CDATA? They
> >are just different ways of expressing the same information.
> 
> I think so. What we are trying to do is embed an XML fragment (or even
> document) inside another XML document (they will have different dtd's).

Mike Kay's point was that it still doesn't matter.

Tim Bray's annotated XML spec explains:

"CDATA sections don't mean anything; they are strictly a convenience to
make XML document authors' lives easier. Suppose I want to include an
example of some XML in an XML document (this isn't that uncommon, after
all I'm about to do it right now). There are two ways I could do this:

<tag>Hello, world!</tag>

and 
<![CDATA[<tag>Hello, world!</tag>]]>

These encode strictly identical data, and there is nothing wrong with
either. The CDATA technique, though, is probably a lot more convenient for
an author, because she can cut chunks of XML out of other documents and
drop them right into the CDATA section, without having to worry about
escaping all those < and & characters."


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

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