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

C. David Shaffer cdshaffer at acm.org
Thu Jul 9 18:46:47 UTC 2009


I'm currently using XML-Parser-mir.14 from XMLSupport on Squeak Source. 
It doesn't seem to handle namespaces correctly though.  When using

XMLDOMParser parseDocumentFrom: aStream useNamespaces: true

it produces a DOM which expands unqualified tag names with their
namespace but leaves qualified tag names alone.  For example:

<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1">
  <author>....</author>
  <openSearch:searchResults>...</openSearch:searchResults>
</feed>

the DOM would looks like:

http://www.w3.org/2005/Atom:feed    <---- this should use a # instead of
a : but I can live with that
   http://www.w3.org/2005/Atom:author
   openSearch:searchResults


Note that openSearch is not expanded.  Also, qualified attribute names
are not expanded.  I looked at the VisualWorks parser in VW7.6 and it
handles this properly by allowing tags and attributes to have both a
#name and an #expandedName unfortunately I can't get the VWXML parser to
load in Squeak (not to mention the fact that the port looks quite old).

Anyone else wrestling with this?

David




More information about the Squeak-dev mailing list