Re: Keeping numeric entities intact when parsing and serializing?
"Nicolas Mendoza" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Organization | PVV |
| Message-ID | <op.u1jzlr014q17ch@akiko> |
On Fri, 09 Oct 2009 23:58:53 +0200, Petr Pajas <[email protected]> wrote: > 2009/10/9 Nicolas Mendoza <[email protected]>: >> On Fri, 09 Oct 2009 22:51:32 +0200, Aristotle Pagaltzis >> <[email protected]> >> wrote: >> >>> * Nicolas Mendoza <[email protected]> [2009-10-09 17:55]: >>>> Is there some way to keep the entities intact when parsing and >>>> serlalizing numeric entities? >>> >>> Why would you want such a thing? >>> >> >> Because I'm feeding it data and I want it to come out the same way? Just >> like & does. (I want to distinguish an incoming ' and "'". So I >> don't want it to alter my valid XML data, basically.) >> >> Actually it's a bit surprising that libxml2 does that. > > Huh? There is absolutly nothing surprising about that, it is an XML > parser? Programming XML would be hell if XML parsers didn't do this. >> From the XML point of view, ' and ' are the same thing! Read the > XML spec. > > To be fair, there are few cases when particular formatting matters, > but those are (supposed to be) dealt with by XML C14N (and possibly > XML Encryption and XML Signature). > I think I can sympathize with your sentiments, but I'm not sure I can agree 100% that altering in-data is the optimal way of functioning. No matter if they are the same in theory. Why would it be hell if XML parsers didn't convert numeric entities to ASCII, UTF-8 (or whatever charset is possible/available at the time) on serialization? -- Nicolas Mendoza http://my.opera.com/nicomen _______________________________________________ Perl-XML mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs