cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: [RT] Alternative Solution to XSP
Date Fri, 22 Jun 2001 01:45:56 GMT
i took a few minutes away from cursing at the pattern substitution code in
c2 to play around with the xsp replacement strategies we've been tossing
around. i decided to go ahead and do a simple implementation of the
InspectionTransformer that i'd suggested. it's attached. NamespaceHandlers
are registered in the sitemap as follows:

<map:transformer name="inspection"
  src="com.webslingerZ.cocoon2.transformation.InspectionTransformer">
  <handler namespace="http://webslingerZ.com/xml/foo/1.0"
    class="com.webslingerZ.cocoon2.util.FooHandler"/>
  <handler namespace="http://webslingerZ.com/xml/foobar/1.0"
    class="com.webslingerZ.cocoon2.util.FoobarHandler"/>
</map:transformer>

then you can apply it to files like this one:

<?xml version="1.0"?>

<root
  xmlns:foo="http://webslingerZ.com/xml/foo/1.0"
  xmlns:foobar="http://webslingerZ.com/xml/foobar/1.0"
>
  <foo:bar/>
  <foobar:bar/>
</root>

as you can tell, if you run the examples and poke through the code, if the
elements produced by the handlers live in one of the namespaces registered
with the InspectionTransformer, they will end up invoking that namespace's
handler. this is gobs easier and more reliable than the xsp logicsheet
application ordering hell that we've got right now. the more i think about
and play with this, the more i like this paradigm.

- donald

Mime
View raw message