Re: [gdome]libxml and namespace declaration attributes



On Wed, Jan 16, 2002 at 01:52:47AM -0500, T.J. Mather wrote:
> i played around a little bit with making namespace declaration attributes 
> work with getAttributes, getAttribute, etc, by searching "nsDef" as well 
> as "properties", and i realized that this is going to be very complicated.
> furthermore, this would not be fully compliant with DOM.  for example, 
> setting an attribute with the same name as an existing namespace 
> declaration attribute would result in the attribute being printed out 
> twice!
> 
> it would simplify things a *lot* if libxml's "properties" in the node 
> structure contained all attributes including namespace declarations.  
> would it be possible make this a run-time option for libxml?  by 
> enabling that option, libgdome would be DOM compliant for ns decl attrs!

  But then this would break with all the other use of libxml2 which know and
assumes that namespace attributes are not shown in the attribute list but
in the nsDef.

> we could make this option turned off by default, as to not break any 
> pre-existing code.

  This is doable, I'm afraid this would break more thing than you expect.
this will definitely break the XSLT and XPath modules for example. So it's
not a simple trick of adding the namespace in the list of attributes
(which is trivial) but then checking all the XPath, XSLT, serialization code
to handle this everywhere to check whether the attribute is defined in both
lists. this is NOT simple, and if you think it's "very complicated" to handle
this in the DOM module, I tell you it woudl be "extremely complicated" to
handle that change correctly in all the other modules.

  Libxml2 API is frozen. I do bug fixing as much as possible. Introducing
major changes like you suggest at that point would be catastrophic, and
I don't buy the "run-time option" thingie because if you change so radically
the data model, things are gonna break seriously *within* that option space
too,

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]