Re: [xml] ' -> ' transform

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:

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++ = ';';

Why these codes are disabled by '#if 0'?
I think it is unexpected that &apos is dumped as '
while &quot is dumped as ".
  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.

Yuuichi Teranishi <teranisi gohome org>
PGP 5.0i Public 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]