[
Lists Home |
Date Index |
Thread Index
]
James Clark wrote:
> If you still think it's easy, try serializing the infoset you get from
> this:
>
> <!DOCTYPE doc [
> <!ENTITY e "<?x y ?>">
> ]>
> <doc>&e;</doc>
Which proves that *re*-serializing data sourced from XML is
substantially harder than generating XML from scratch. Obvious when you
think about it.
I think I still claim that in the normal case of generating XML output
from your internal program data, all you really need are print
statements and an escape() function. And yes, you might as well escape
*all* instances of <, &, ', ", and >, since this costs nothing and
avoids potential risks.
James is right, we screwed up in letting attribute normalization into
XML. It still boggles my mind in retrospect that during the discussions
back in 96-97, nobody piped up to say "why are you morons doing this?"
Because we probably would have said "D'oh, right, lose it." Sigh.
--
Cheers, Tim Bray
(ongoing fragmented essay: http://www.tbray.org/ongoing/)
|