Re: [xml] XML beginner's question

On 18Nov08 12:24, Andrew M. wrote:
}Code runs fine without printf(), so I am supposing xmlNodeListGetString()
}might be failing. Any suggestions?

cur is uninitialised in main() at the following line:

        cur = cur->xmlChildrenNode;

You probably mean doc->children (or doc->xmlRootNode if you're going to use
the old libxml1 compat calls) or better still, call xmlDocGetRootElement().

I was surprised to find that gcc didn't pick this up. BTW, variables should
all be declared at the top of a function for most C compilers.



Callum Gibson @ home

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]