Re: [xml] Node structure questions...



On Thu, Apr 03, 2003 at 12:55:02PM -0800, Jerome Pesenti wrote:
Greetings,

Why is the value of an attribute a list of nodes? Is

 yes

it to be able to represent the succession of text
and entity references? If so, wouldn't it be more

  also because it matches the XPath datamodel.

space savy to have a light structure for those instead
of the full xmlNode structure (10 pointers of so)?

  I have a lighter structure for xmlNs and it's a MAJOR
headache for XPath processing.

Also, is that an actual XML requirements, can't the
entity references be all resolved?

  No, libxml was designed as an editing toolkit, not a mere parsing
tool.

Doing some profiling on libxml, it seems that building
a tree without attributes is very fast but that having
a lot of attributes is very costly.... I just thought
I would mention it....

  Attribute processing is more complex than standard node 
processing, they have types, their content needs to be 
modified, there is defaulting, etc ... Adding an attribute
to a tree is at least as expensive as adding a sub element.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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