[xml] Re: gnome-xml attribute quoting question

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Fri Nov 12 1999 - 11:49:56 EST


On Wed, Oct 27, 1999 at 10:10:20PM -0700, Raph Levien wrote:
> Hi Daniel,
>
> I have a question about attribute quoting, and wondering if it's
> something I'm doing wrong, or perhaps a problem with gnome-xml.

  A problem with libxml :-)

> If I have <tag attr="bits &amp; pieces">, then the xmlGetProp()
> call quite reasonably returns "bits & pieces". But if I pass this
> string into xmlSetProp() and write the file, it complains of an
> unterminated entity.
>
> It looks to me like this is an asymmetry between the use of
> xmlNodeListGetString in xmlGetProp (which sets inLine = 1), and
> xmlStringGetNodeList in xmlSetProp, which seems to expect its value to
> have its entities quoted.
>
> So to do a roundtrip, it looks like I have to do an
> xmlEncodeEntitiesReentrant() between the Get and the Set. This doesn't
> seem right to me. What am I missing here?

  Right, and Fred Drake triggered that as a bug
    http://bugs.gnome.org/db/35/3504.html

So basically I changed xmlSetProp() and xmlNewProp() to do the
call to xmlEncodeEntitiesReentrant() so that the functions
New, Set and Get are at the same level. This makes far more sense
and I hope won't break too many things, this should be commited within
an hour in CVS.

Daniel

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


Date view Thread view Subject view Author view

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