You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Richard Cook <rp...@prismtechnologies.com> on 2001/12/06 12:59:36 UTC
trax
Hello,
According to the xalan docs, TrAX is independent of XSLT - ie not tied to
only performing transformations using xslt. We have a processor which is
indeed not XSLT, but we also need to support XSLT. With TrAX, the user calls
TransformerFactory.newInstance(), which uses a system property
javax.xml.transform.TransformerFactory to determine which concrete class to
instantiate.
The problem is that subsequently from this piece of code:
Transformer transformer = factory.newTransformer(Source)
We want:
If the Source is an XSLT stylesheet, to use an XSLT processor (xalan etc)
If the Source specifies instructions our processor handles, we want to use
our processor.
We have an implementation of Source which specifies the location of our
instructions, so distinguishing from StreamSource etc is no problem at this
level.
But the single system property which determines which TransformerFactory
implementation means that if we use our implementation, we don't know which
XSLT processor the user wants.
Does that make sense?
Options we have:
Use TransformerFactory.newInstance() for XSLT, use normal constructor for
our processor
TransformerFactory.newInstance() returns our implementation, we define our
own system property for the XSLT implementation. This would mean that people
using the default processor rather than the system property would presumably
find their code stops working.
(Apologies that this is not xalan specific, is there a better place to ask
the question?).
Thanks, Rich
RE: trax
Posted by Richard Cook <rp...@prismtechnologies.com>.
I think we may be talking cross purposes (I'm rubbish at explanations).
Essentially we have two TrAX implementations, one proprietary, one XSLT (ie
xalan). In fact currently our implementation does perform the passthru to
the xslt processor - but if the property points to our implementation we
don't know what xslt processor to use unless we use constructor for our
Transformer impl and use TrAX proper for xslt
Re: trax
Posted by Raber Chris <cp...@yahoo.com>.
How about if you provide a trax wrapper to your
non-trax processor? The system property can be set to
ythe wrapper...
GOF Adapter pattern...
--- Richard Cook <rp...@prismtechnologies.com> wrote:
> Hello,
>
> According to the xalan docs, TrAX is independent of
> XSLT - ie not tied to
> only performing transformations using xslt. We have
> a processor which is
> indeed not XSLT, but we also need to support XSLT.
> With TrAX, the user calls
> TransformerFactory.newInstance(), which uses a
> system property
> javax.xml.transform.TransformerFactory to determine
> which concrete class to
> instantiate.
>
> The problem is that subsequently from this piece of
> code:
>
> Transformer transformer =
> factory.newTransformer(Source)
>
> We want:
> If the Source is an XSLT stylesheet, to use an
> XSLT processor (xalan etc)
> If the Source specifies instructions our processor
> handles, we want to use
> our processor.
>
> We have an implementation of Source which specifies
> the location of our
> instructions, so distinguishing from StreamSource
> etc is no problem at this
> level.
>
> But the single system property which determines
> which TransformerFactory
> implementation means that if we use our
> implementation, we don't know which
> XSLT processor the user wants.
>
> Does that make sense?
>
> Options we have:
> Use TransformerFactory.newInstance() for XSLT, use
> normal constructor for
> our processor
> TransformerFactory.newInstance() returns our
> implementation, we define our
> own system property for the XSLT implementation.
> This would mean that people
> using the default processor rather than the system
> property would presumably
> find their code stops working.
>
>
>
> (Apologies that this is not xalan specific, is there
> a better place to ask
> the question?).
>
> Thanks, Rich
>
__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com