Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] Getting non-XML result from XML parsing

Kevin L. Cobb

2005-10-10

Replies:

The JDOMResult object JavaDoc gives this example on how to get a List of JDOM Nodes back. What if the result of my parse is not an XML document at all, but is a Text String?
 
   public static List transform(Document doc, String stylesheet)
                                        throws JDOMException {
     try {
       Transformer transformer = TransformerFactory.newInstance()
                             .newTransformer(new StreamSource(stylesheet));
       JDOMSource in = new JDOMSource(doc);
       JDOMResult out = new JDOMResult();
       transformer.transform(in, out);
       return out.getResult();
     }
     catch (TransformerException e) {
       throw new JDOMException("XSLT Transformation failed", e);
     }
   }
 
-Kevin

 
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.