EJB design: XML Parser uding XSLT and SAX

  1. XML Parser uding XSLT and SAX (1 messages)

    can some one guide me on creating a sample xml parser using sax and xslt where in the output of the xml parser must be a xml file ?

  2. import net.sf.saxon.TransformerFactoryImpl; import javax.xml.transform.*; import javax.xml.transform.stream.*; public class TransformXsl { public static void main (String[] args) { try { TransformerFactory factory = TransformerFactory.newInstance(); Transformer tobj = factory.newTransformer(new StreamSource("filescheck.xsl")); System.setProperty("javax.xml.transform.TransformerFactory","net.sf.saxon.TransformerFactoryImpl"); tobj.transform(new StreamSource("dataset.xml"), new StreamResult(new File("filecheck_error.xml")); } catch (Exception e) { System.out.println("Exception: " + e); } } } Regards.