Re: [xml] entity ref. in attribute value

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Wed Jun 28 2000 - 02:31:44 EDT


On Tue, Jun 27, 2000 at 11:05:39PM +0200, Petr Kozelka wrote:
>
> First of all, thank you (Daniel) for your quick replies.
>
> Now I have this problem: with the SAX parser, I receive startElement notification with attribute list. But attribute values in this
> list (each second string) are not unescaped, ie. when I have attribute like
> <test we="you &amp; I"/>
> I would expect to get the string "you & I" for the 'we' attribute, but what I get is exactly the same like what I have in xml file.
> - is this correct ? (I suppose no)
> - if yes, what I have to do to get the correct string? Do I have to parse the value myself ?

  That's IMHO a limitation of the original SAx interface as provided
by expat, one can return only attribute strings. Since i want to
be able to generate entity ref within attribute values in the DOM tree
I have to pass the value as parsed and do the entity lookup later on.
Check the attribute() function in the SAX.c module.
  I think that if you ask for automatic entity replacement, then
in that case you will get substituted values.
  I didn't want to bypass the SAX layer when implementing the DOM
tree so I had to make a couple of decisions like this.

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@xmlsoft.org
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@xmlsoft.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:30:16 EDT