Re: Advice needed on an XSL v/s DOM imlementation

Subject: Re: Advice needed on an XSL v/s DOM imlementation
From: Dave Halls <daveh@xxxxxxxxxxxxxxx>
Date: Tue, 17 Nov 1998 10:58:25 +0000
I use Docuverse's DOMSDK's HTMLFactory to build up HTML elements,
then stringify it to a file. Actually, I added on some minimization for
elements
with minimization tags in the HTML 4.0 DTD, it's very easy to do.

DOMSDK seems to work well. There is a small problem with
DocumentFragments
but I understand that will be fixed in the next release.

Also, I've embedded a matching/pattern facility in Java, so my
transformation
programs specify the patterns, then build HTML in response. The patterns

are basically a combinator parser from which one builds matches on the
DOM tree.

e.g.


 onlyElement("label").and(
  inAncestor(onlyElement("format"))).fires(

  new Handler()
  {
   public Object fire(Bindings b, Matcher m, Node n)
   {
    DocumentFragment frag = doc.createDocumentFragment();

    Util.appendChildren(frag,
       Query.processChildren(textPattern, n));

    return frag;
   }
  })).or( .........
[lots of patterns left out]

Basically, one composes rules using small, clean, functional
combinators.
Then when a rule fires, one creates some HTML and returns it.
The HTML is then amalgamated, forms a tree and bob's your uncle,
you print it to a file or whatever.
The patterns built up can be complex, I have some demos in which an
orgchart is rearranged into a set of linked GIFs for instance,
and a complete electronic forms app too.

I hope to write this up (I already have Javadoc for it all) and release
some
JAR file soon.

We've done the same in Standard ML, which being a functional programming

language makes certain things look nicer - but obviously not as many
people
use that. We hope to make that available too.

This may not have helped but I guess it might be a pointer to things
one can do using using the DOM and a PL.

Dave



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread