This caught me up this past weekend. 

The Template that Bryan is reading into an Object is not the compiled
translet class that you get when you use the command line compiler. 

He wrote a utility which compiles the style sheet to a Template Object
instance, then serializes that instance. 

When he reads the object, it is actually a Template instance, not a Class of
any kind. That's why the cast to Template works.

Correct me if this isn't accurate.

Packaging yet another type of file is not something I wanted to deal with
for this, so I put my attempts to use a Template on the shelf and am just
directly instantiating a new Translet from the Class for each application. 

        easy,
        douglas d 

-----Original Message-----
From: Burgard Olivier [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 29, 2002 6:07 AM
To: [EMAIL PROTECTED]
Subject: Re: Getting a transformer from a translet. 


Hello

> So this means that the compiled Translet Class implements the Templates
> interface? It doesn't in the JavaDoc, so this is part of what I was
missing
> if it's true.

I tried this :
javax.xml.transform.Templates template = (javax.xml.transform.Templates)new
myTranslet();

myTranslet was compiled with : org.apache.xalan.xsltc.cmdline.Compile

But I got a ClassCastException. So, the JavaDoc is right and the compiled
Translet Class doesn't implements the Templates interface...

I don't know how to get a Transformer from a Translet and the "transform"
method
of Translet doesn't allow us to transform already parsed Xml...

Olivier.

Reply via email to