[lxml-dev] Objectify and a text-tag
Hi assuming i've got an XML like <foo><text>blabla</text></foo> How am I supposed to change the blabla text? foo.text does obviously not work since that is the text value of foo. foo['text'] would have been nice, but that's not working either. Any suggestions? -- Christian Zagrodnick gocept gmbh & co. kg · forsterstrasse 29 · 06112 halle/saale www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Christian Zagrodnick wrote:
Hi
assuming i've got an XML like
<foo><text>blabla</text></foo>
How am I supposed to change the blabla text? foo.text does obviously not work since that is the text value of foo.
foo['text'] would have been nice, but that's not working either.
Any suggestions?
Maybe 'foo.find("text")'? Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF4u5c+gerLs4ltQ4RApyQAJ9qU4SjZG4ZEoPwxJrkAiOjP3dWBQCeJ0Bt 246x0g446Gjo3gargkn9Tt4= =CIRg -----END PGP SIGNATURE-----
On 2007-02-26 15:27:41 +0100, Tres Seaver
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Christian Zagrodnick wrote:
Hi
assuming i've got an XML like
<foo><text>blabla</text></foo>
How am I supposed to change the blabla text? foo.text does obviously not work since that is the text value of foo.
foo['text'] would have been nice, but that's not working either.
Any suggestions?
Maybe 'foo.find("text")'?
Well... that doesn't create the tag. The charm of foo.bar = 'baz' is that it creates the tag if it isn't there. -- Christian Zagrodnick gocept gmbh & co. kg · forsterstrasse 29 · 06112 halle/saale www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891
Hi, Christian Zagrodnick wrote:
assuming i've got an XML like
<foo><text>blabla</text></foo>
How am I supposed to change the blabla text? foo.text does obviously not work since that is the text value of foo.
foo['text'] would have been nice, but that's not working either.
Ah, right. That's a bug, I'd say. We special case things like 'text' in __setattr__(), but not in __setitem__(), where we delegate to __setattr__ for the easy stuff. I'll see how to fix that. Stefan
Hi, Stefan Behnel wrote:
Christian Zagrodnick wrote:
assuming i've got an XML like
<foo><text>blabla</text></foo>
How am I supposed to change the blabla text? foo.text does obviously not work since that is the text value of foo.
foo['text'] would have been nice, but that's not working either.
Ah, right. That's a bug, I'd say. We special case things like 'text' in __setattr__(), but not in __setitem__(), where we delegate to __setattr__ for the easy stuff.
I'll see how to fix that.
Should be fixed on the trunk now. Have fun, Stefan
Morning
On 2007-02-26 18:29:46 +0100, Stefan Behnel
Stefan Behnel wrote:
Christian Zagrodnick wrote:
assuming i've got an XML like
<foo><text>blabla</text></foo>
How am I supposed to change the blabla text? foo.text does obviously not work since that is the text value of foo.
foo['text'] would have been nice, but that's not working either.
Ah, right. That's a bug, I'd say. We special case things like 'text' in __setattr__(), but not in __setitem__(), where we delegate to __setattr__ for the easy stuff.
I'll see how to fix that.
Should be fixed on the trunk now.
Great! Will try that out later today. -- Christian Zagrodnick gocept gmbh & co. kg · forsterstrasse 29 · 06112 halle/saale www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891
participants (3)
-
Christian Zagrodnick
-
Stefan Behnel
-
Tres Seaver