On Thu, 21 Jun 2001, Berin Loritsch wrote:

> > for this to work in the current environment, i'd have to known that the
> > 'my' transformer is probably going to need to call the 'sql' transformer
> > immediately after it. that should not be the concern of the sitemap
> > maintainer...
>
> And we are back to another one of your points on XSP: ordering is difficult
> and has profound effects on the resultant code.

right! so what i'm thinking now is that we can write an
InspectionTransformer which can call other Transformers seamlessly - at
least, Transformer which have registered themselves as being responsible
for a particular namespace. let's see:

public class InspectionTransformer {

  static Map registeredTransformers;

  public void startElement(String uri, String name, String raw, Attributes attributes) 
{
    if (registeredTransformers.containsKey(uri)) {
      Transformer transformer = //obtain reference to other transformer somehow
      transformer.compose(...);
      transformer.setup(...);
      transformer.setContentHandler(this);
      transformer.startElement(uri,name,raw,attributes);
    } else {
      super.startElement(uri,name,raw,attributes);
    }
  }

  ...

}

naturally, some more thought is required here - one would not necessarily
want to create a new Transformer instance for every element we find in the
new namespace; probably we'll need to maintain some sort of stack of
transformers inside the InspectionTransformer. but this is the gist.
thoughts?

- donald


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to