[squeak-dev] XML DOM parser which properly handles namespaces?

C. David Shaffer cdshaffer at acm.org
Thu Jul 9 19:14:44 UTC 2009


Michael Rueger wrote:
> Would that be what you would like to get (DOM with both name and
> expandedName entries)?
>
> I'm not sure I'll find the time right now to implement this, but if
> anyone feels like diving into it? :-)
I'm not sure what other people expect.  Right now attributes are stored
in a string -> string.  Moving to an XMLAttribtue would confuse a lot of
code.  So, for attributes we're stuck with either expanding the name
(useNamespaces == true) or not (useNamespaces == false).  It makes sense
to follow this convention with Nodes as well (ie tag names).

I think that I can make the fixes:


   expand all tag names if useNamespaces == true
   expand all attribute names if useNamespaces == true

I'll keep the convention of using $: to separate the namespace IRI from
the tag/attribute name since someone might depend on that.  I looked
through the XML namespaces spec and it never talks about the "expanded
name".  All namespaces must be declared and the only valid way to refer
to them is through the abbreviated name.  Still, this seems contrary to
the convention used in Schema.  For example, if I have some XML schema
and I want to refer to some type in it I would use the form IRI#type. 
Anyway...

David




More information about the Squeak-dev mailing list