[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT + SAX solution

Subject: XSLT + SAX solution
From: "Razvan Veina" <veina.razvan@xxxxxxxxxxxxxxx>
Date: Wed, 28 Jan 2004 11:41:36 +0200
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.