[XML-SIG] Functional interface to XML?

uche.ogbuji@fourthought.com uche.ogbuji@fourthought.com
Mon, 15 Feb 1999 20:47:00 -0700


> Mike Olson wrote:
> > We are currently working on an XSL processor that sits ontop of 4DOM which
> > inturn sites ontop of sax.  It does not fire events in the sax fashion,
> > but will return a DOM tree of formatting objects, when given a XML DOM
> > tree with xml-stylesheet processing instructions.

Paul Prescod:
> First, why not generate SAX events and then use your existing DOM builder
> to make the formatting object tree. That way you would be able to daisy
> chain XSL filters and other filters.

I don't think we've thought of this, and it's actually a good idea.  We 
primarily use it to emit HTML or transformed (non-FO) XML for now, but we 
could provide a SAX interface to make it more useful.

Just as interestingly, though, your suggestion exposes a weakness in 4DOM that 
I had already planned to rectify by 0.7.1.  Currently our Builder module 
hard-codes a SAX handler.  The handler class itself should be a parameter so 
that users can chain filters all they want while building DOM nodes from SAX 
events.

> Second, is the API such that some of the facilities are useful from
> Python? For instance can you easily look up nodes given a pattern, or do
> an XSL pattern-based "visit" of a node tree?
> 
> I'm not sure if it is clear what I am getting at. XSL processing could be
> regarded as a special case of "pattern-based tree visiting." That might
> allow us to use an XSL visitor pattern in ordinary Python code.

Well, I'm still not sure I get your meaning, but the pattern-matching code is 
pretty well de-coupled from the tree-visiting portion.  This is to allow 
easier updates as the XSL WG modifies their spec.  I'm not sure how usable the 
API would be when exposed outside 4XSL, but we can certainly keep such 
potential use in mind.

Are you thinking of maybe extending the transformation facilities of a 
style-sheet using Python, rather than the erstwhile ECMAScript?


-- 
Uche Ogbuji
FourThought LLC, IT Consultants
uche.ogbuji@fourthought.com	(970)481-0805
Software engineering, project management, Intranets and Extranets
http://FourThought.com		http://OpenTechnology.org