Re: [xml] ' -> ' transform
- From: teranisi gohome org (Yuuichi Teranishi/寺西裕一)
- To: xml gnome org
- Subject: Re: [xml] ' -> ' transform
- Date: Mon, 23 Apr 2001 10:23:50 +0900
At Sun, 22 Apr 2001 04:42:53 -0400,
Daniel Veillard wrote:
On Thu, Apr 19, 2001 at 07:52:47PM +0900, Yuuichi Teranishi wrote:
Hi,
In the file entities.c from the line 661 (On latest CVS),
there are codes like:
#if 0
} else if ((*cur == '\'') && (!html)) {
*out++ = '&';
*out++ = 'a';
*out++ = 'p';
*out++ = 'o';
*out++ = 's';
*out++ = ';';
#endif
Why these codes are disabled by '#if 0'?
I think it is unexpected that &apos is dumped as '
while " is dumped as ".
http://www.w3.org/TR/REC-xml
2.4 Character Data and Markup
-------------
To allow attribute values to contain both single and double quotes,
the apostrophe or single-quote character (') may be represented as
"'", and the double-quote character (") as """.
-------------
It's a 'may' not a 'must'. I used to do it and I don't anymore.
There is probably a good reason but I can't remember why.
My guess was;
Libxml always dumps attribute values with " (double-quote) enclosure,
so there's no need to encode ' as '.
But libxml encodes " to " and does not encode ' to '
even while dumping the text node content.
For readability, I think it is better not to encode single/double-quote
character to the entity string while dumping the text content.
Thanks.
--
Yuuichi Teranishi <teranisi gohome org>
PGP 5.0i Public Key: http://www.gohome.org/pgp5/teranisi.key
"Only time will tell if I am right or I am wrong..."
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]