Re: Keeping numeric entities intact when parsing and serializing?
by Nicolas Mendoza other posts by this author
Oct 10 2009 3:48AM messages near this date
view in the new Beta List Site
Re: Keeping numeric entities intact when parsing and serializing?
|
Re: Keeping numeric entities intact when parsing and serializing?
& XSLT On Sat, 10 Oct 2009 12:30:45 +0200, Aristotle Pagaltzis <pagaltzis@[...].de>
wrote:
> * Nicolas Mendoza <mendoza@[...].no> [2009-10-10 12:20]:
> > So, given that we accept this, why is & not converted to "'"?
>
> You mean `&`.
>
> It is, when parsing. But it has to be escaped for the XML to
> be valid, so when generating output, it is expressed as `&`.
> If you write it `&` in the input (which means the same `&`
> character), youâll see that the output still comes out `&`
> and not `&`. Because itâs the same thing.
>
> You still havenât told us why you would want this. Are you using
> software that processes XML documents, but as text blobs rather
> than as XML documents? Or do you want it for legibility of the
> output?
>
> Regards,
I basically want to distinguish two different data sources, after parsing
them as XML and merging them, so I thought it was possible to use entities
in one of them explicitly, and the other not.
I see now that it's ONLY & that is kept as-is. I was falsely under the
impression that named entities was handled different from numeric
entities, but I see now that this is not the case. Hence my original issue
with lack of consistency is invalid.
$ perl -wle 'use XML::LibXML; my $x = XML::LibXML-> new(); my $d =
$x-> parse_string("<xml>' ' \x27</xml>"); print $d->toString();'
<?xml version="1.0"?>
<xml> ' ' '</xml>
Thanks for the info everyone and sorry for your waste of time ;-)
--
Nicolas Mendoza
http://my.opera.com/nicomen
_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Nicolas Mendoza
Mirod
Jenda Krynicky
Nicolas Mendoza
Aristotle Pagaltzis
Nicolas Mendoza
Aristotle Pagaltzis
Petr Pajas
Nicolas Mendoza
Petr Pajas
Nicolas Mendoza
Aristotle Pagaltzis
Nicolas Mendoza
Nicolas Mendoza
Petr Pajas
|