Re: API compatability

On Tue, 2012-10-02 at 15:53 -0700, David Lee wrote:
[...]
> What would it take, in theory, to take a MicroXML parser and plug it
> into a toolset expecting an XML parser ?

If they both produce sax events (say) it might be very easy...

> Concrete:
> Say for example I wanted to use JAXB or say Saxon XSLT ... but use my own MicroXML parser ...
> what would that mean ?

Since µXML doesn't support flamespaces (as i used to call them), and
XSLT requires them, you would need an adaptor or bridge or connector.

E.g. I can imagine a sax adapter that lied and put XSLT elements into
the XSLT namespace.

Note that although I think every µXML document is an XML document, they
don't all have the same meaning, for one thing because of attribute
value normalization. This probably won't matter in your use case.

If you start coming up with conventions for namespaces, there's a danger
you end up building something as complex as XML namespaces are in
practice. And indeed, if you want to represent XSLT stylesheets that's
pretty much what I think you'd need to do.

My "microbe" unobtrusive namespaces processor [1] might help, though, if
you're willing to accept some limits on your XSLT stylesheet, for
example not using direct element constructors. Or extend microbe to
understand "*" so that you can put those element constructors into their
own namespaces. Microbe could be extended to cover more of the design,
e.g. by introducing prefix bindings as well as default namespaces, and
then maybe you could have qnames in content working properly so that you
could use XSLT on XML documents with namespaces, such as XSLT
stylesheets.

Liam

[1] http://words.fromoldbooks.org/xml/microbe/

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

Received on Wednesday, 3 October 2012 05:14:34 UTC