[jdev] Child nodes of DOM Attr

Justin Karneges justin-keyword-jabber.093179 at affinix.com
Mon Sep 17 21:19:14 CDT 2007


On Monday 17 September 2007 6:20 pm, Joonas Govenius wrote:
> On 9/17/07, Joonas Govenius <joonas.govenius at gmail.com> wrote:
> > Hi all,
> >
> > I ran into this problem with the Qt DOM implementation when writing
> > some code for shared XML editing:
> >
> > If I try to insert a DOM Text node to a DOM Attr node using
> > appendChild(), nothing happens. Does anyone know for sure whether
> > that's the correct behavior?
>
> I guess this is standard. Firefox tells me "Modifications are not
> allowed for this document" if I try to do this with JavaScript:

What on earth are you doing?! :)  Attributes have a single value.  They do not 
have child text nodes.

You mentioned Qt DOM.  In that case consider QDomAttr.setValue("value").  More 
conveniently, just call QDomElement.setAttribute("name", "value").

-Justin



More information about the JDev mailing list