Re: [xml] Re: Access Violation

On Mon, Jul 28, 2003 at 04:17:00PM +0100, Vincent Finn wrote:
Daniel Veillard wrote:
Is there anything here that looks wrong to anyone?

  accessing ->content without checking the type of the node first
is 100% wrong. You're making assumption which is very likely to be false.

In my case it won't ever be false.
Unless I have misunderstood content is for getting the text from a text 
node, in which case I would have thought what I am doing is fine

  Well you're asking, giving only a code subset, and pointed out something
which looked obvious to me. If you know better, perfect !

Is using content inherently unsafe?

  Without checking the node type first, yes. Otherwise it's on a case
by case basis depending on the node type.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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