Re: [xml] What would make xmlSetProp return null?
- From: Marco Rogers <marco rogers gmail com>
- To: xml gnome org
- Subject: Re: [xml] What would make xmlSetProp return null?
- Date: Sun, 6 Jun 2010 17:17:44 -0400
bjoern:
Thanks, that was it. ÂDealing with text nodes instead of elements. ÂAny idea on how to enable the debug functions?
On Sun, Jun 6, 2010 at 4:20 PM, Bjoern Hoehrmann
<derhoermi gmx net> wrote:
* Marco Rogers wrote:
>I have two versions of my codebase with pretty minimal changes. ÂHere's the
>call to xmlSetProp
>
> Â Â xmlAttr *elem = xmlSetProp(element->xml_obj,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (const xmlChar*)*name,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (const xmlChar*)*value);
>
>The var element->xml_obj is a xmlNodePtr.
>
>In the old version of the code this produced a valid attribute. ÂIn the new
>version it doesn't. ÂThis is part of a non-trivial codebase that is
>integrated with google v8 so provided more context is difficult. ÂI've
>checked all of the values and they seem valid. ÂBut elem always ends up
>being null. ÂAny idea where/how I should start to debug?
My guess would be you do not have an element node, but rather some other
node type. A quick look at the source suggests you get NULL in that case
or if the node or the name is NULL, or some rather involved conditions
(see `xmlGetPropNodeInternal`).
--
BjÃrn HÃhrmann  mailto:bjoern hoehrmann de  http://bjoern.hoehrmann.de
Am Badedeich 7 Â Telefon: +49(0)160/4415681 Â http://www.bjoernsworld.de
25899 DagebÃll  PGP Pub. KeyID: 0xA4357E78  http://www.websitedev.de/
--
Marco Rogers
marco rogers gmail comLife is ten percent what happens to you and ninety percent how you respond to it.
- Lou Holtz
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]