[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] XSLT + SAX solution
Hello everyone, I finally got a solution to this one, and I'll post it here, maybe someone will need it in the future. It is based on an example from xalan. (Sorry for the poor formatting :) SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory); PrintWriter out = new PrintWriter ( new FileOutputStream ("result.out") ); TransformerHandler tHandler1 = saxTFactory.newTransformerHandler(new StreamSource(sLayoutFileName)); TransformerHandler tHandler2 = (TransformerHandler) ( new ExpandBarcodes ( out ) ); XMLReader reader = XMLReaderFactory.createXMLReader(); reader.setContentHandler(tHandler1); reader.setProperty("http://xml.org/sax/properties/lexical-handler", tHandler1); tHandler1.setResult(new SAXResult(tHandler2)); reader.parse ( sXmlDataFileName ); The ExpandBarcodes class implements the ContentHandler interface and writes to the out parameter. Thanks everyone for your help !!! XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|