Re: [xml] Patch for HTML SCRIPT

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Sun Oct 15 2000 - 10:20:45 EDT


On Sun, Oct 15, 2000 at 01:40:50PM +0000, Bjorn Reese wrote:
> I looked at the attribute problem today, and made the attached patches.

  thanks for working on this !

> The change to HTMLtree.c prevents HTML attributes from being encoded
> when they are output.

  Hum, actually I think special characters in HTML attribute should be
escaped in all cases:
http://www.w3.org/TR/html4/appendix/notes.html#notes-specifying-data
----------------
Note. The DTD defines script and style data to be CDATA for both element
   content and attribute values. SGML rules do not allow character references
   in CDATA element content but do allow them in CDATA attribute values.
----------------

> I have not found any justification for (or
> against) this in the HTML specification, but the change makes sense
> considering that one can embed code in attributes. Maybe this should
> be limited to event attributes?

  Well I think the previous Note makes clear that there is actually
a difference. I do think that the escaping is actually required by
SGML. Anyway it's allowed and for cleanness I think it should be used.
I actually wondered if this should be changed yesterday and started
working on it until I find the Note. I will add the detection function I
wrote yesterday since event attibute probably need special handling
at the client level anyway:

    int htmlIsScriptAttribute(const xmlChar *name);

> The change to SAX.c normalizes the HTML attributes. The normalization
> scheme mentioned in http://www.w3.org/TR/html4/types.html#h-6.2 looks
> suspiciously like that of XML attribute normalization.

   I think it's due to XML Dtd specification being a compatible
subset of SGML Dtd's ones. Hence the inherited rules for the content
model of attributes in both metalanguages are similar, no surprize
but good catch ! I have applied that patch :-)

Daniel

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux XML libxml WWW
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
 http://www.w3.org/People/all#veillard%40w3.org  | RPM badminton Kaffe
----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 10:43:53 EDT