[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] Tradeoffs of XML encoding by enclosing all content in CDATA blocks
- From: "Michael Kay" <mike@saxonica.com>
- To: "'Andrew Welch'" <andrew.j.welch@gmail.com>,"'Karr, David'" <david.karr@wamu.net>
- Date: Mon, 29 Sep 2008 16:51:44 +0100
> You often get this problem when people write XML as a string
> rather than using a proper XML Writer...
>
> For example:
>
> xmlStr = "<foo>" + someVal + "</foo>";
> write(xmlStr);
>
> The are several problems with this approach, one being that
> ampersands won't be escaped properly.
I've also seen such code result in a performance bottleneck. It turned out
that generating the XML was taking significantly longer than subsequent
parsing, validating, and transforming of the same XML. It's much more likely
to be optimized if you use a library that has been carefully written by
someone else.
Michael Kay
http://www.saxonica.com/
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]