HaXml, namespace processing
gk at ninebynine.org
Tue Jun 22 12:39:57 EDT 2004
Since my last HaXml missive , I've managed to get some XML namespace
handling code working with HaXml.
The namespace processing itself is implemented as a transformation/filter
that is applied to XML content after general entity substitution has been
performed. The XML content model has been extended to use QNames for
element and attribute names (this change was made some time ago), and also
to carry XML-Infoset-like information with each element (including a list
of in-scope namespaces).
When namespace processing is performed, the xmlns attributes are scanned
and removed from the XML content. Element and attribute names containing
':' are reprocessed to be in a namespace+local name form. Also, is a
default namnespace is in scope, element names not containing a ':' are
similarly processed (but not attribute names, because the meaning of
unprefixed attributes is determined by the containing XML element).
I've created a small suite of test cases for namespace processing, which
work by extracting the list of element and attribute QNames from a
processed document, and comparing the result with a given list.
Also since my last message , I've created a test suite for the XML
validator, based on the W3C XML conformance data. HaXml passed all but two
of these tests without further modification.
I've created another snapshot  of my work.
This represents all of the major functional changes I plan to make at this
time, though there is a good deal of code tidying, and a few small features
I'd like to add, which I may get round to at some time. My changes are
also rather devoid of external documentation. The test harness  is one
place to look. The namespace handling functions are in module Namespace.hs
More information about the Libraries