[jdom-interest] Using TraX

Jason Hunter jhunter at acm.org
Wed Apr 17 03:45:48 PDT 2002


After the transform it's no longer a MyDocument.  You could set the
factory on JDOMResult if you wanted that.

-jh-

Jasmeet.Singh at eontec.com wrote:
> 
> HI  All
> 
> I am trying to use JDOM TraX for transforming the source JDOM document into
> another
> 
> i use the following as in javadoc for the classes
> 
>     try {
> 
>         Transformer transformer = TransformerFactory.newInstance
> ().newTransformer(new StreamSource(stylesheet));
>         JDOMResult out = new JDOMResult();
>         transformer.transform(new JDOMSource(in), out);
>         return (MyDocument) out.getDocument();
> 
>     } catch (Exception e) {
>         throw new MyException("XSLT Trandformation failed :: " +
> e.getMessage());
>     }
> 
> I get a class cast exception while casting out.getDocument() to
> MyDocument..
> MyDocument is a subclass of org.jdom.Document.. I have using JDOMFactory as
> a subclass of DefaultJDOMFactory to get my own version of Docments and
> Elements
> 
> Am i missing anything in this transformation ni particular
> 
> thanks
> jasmeet
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list