[jdom-interest] Using TraX

Jasmeet.Singh at eontec.com Jasmeet.Singh at eontec.com
Wed Apr 17 04:14:54 PDT 2002


OK

Then my specific question is

How do we set the factory on JDOMResult so that the output that's returned
after out.getDocument() can be casted to my own subclass of Document. ?

The builder.setF actory(new MyFactory()) has been done while creating
MyDocument from SAXBuilder.

thanks
-js-


                                                                                                                                
                    Jason Hunter                                                                                                
                    <jhunter at acm.        To:     Jasmeet.Singh at eontec.com                                                       
                    org>                 cc:     jdom-interest at jdom.org                                                         
                                         Subject:     Re: [jdom-interest] Using TraX                                            
                    04/17/02                                                                                                    
                    11:02 AM                                                                                                    
                                                                                                                                
                                                                                                                                



The Javadocs are best.  The source is there if the Javadocs aren't
explicit enough.  Specific questions get answered on this list.

-jh-

Jasmeet.Singh at eontec.com wrote:
>
> Thanks Jason
> But how do i do that ..
> is there a place where i can have guidelines for this
>
> thanks
> jasmeet
>
>
>                     Jason Hunter
>                     <jhunter at acm.        To:     Jasmeet.Singh at eontec.com
>                     org>                 cc:     jdom-interest at jdom.org
>                                          Subject:     Re: [jdom-interest]
Using TraX
>                     04/17/02
>                     10:45 AM
>
>
>
> 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