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

Applying XSLT to SAX Reader

Subject: Applying XSLT to SAX Reader
From: "Bruce McDougald" <bmcdougald@xxxxxxxxxxx>
Date: Mon, 7 Oct 2002 12:22:17 -0500
sax reader
I am having a problem trying to transform output from a SAX reader.  Looking
at the XALAN FAQ,
I believe the way I am supposed to do this is to use a "pipe", or "chain"
method.  I think I have
a code setup properly to handle this, but the XSL stylesheet
is not being applied to my parsed XML, I just get the parsed XML out of my
SAX reader events
displayed back to the screen.  This is driving me crazy!
I've spent 3 days trying to feed this parsed XML into a transformation
process, but NO LUCK!!


Here is the code I have written so far, if needed, I will post the code for
the xmlParse filter:

Note:  xmlParse class to extends XMLFilterImpl and handles my SAX events.
Also, in my serializer OutputProperties method, I have tried setting it to
'html', 'xml', and
'out', and the output is the same everytime not matter what.

Thanks for your help.

////////////////////////

    TransformerFactory tFactory = TransformerFactory.newInstance();

    if (tFactory.getFeature(SAXSource.FEATURE) &&
                 tFactory.getFeature(SAXResult.FEATURE))
    {

      XMLReader reader = XMLReaderFactory.createXMLReader();

      SAXTransformerFactory saxTFactory = ((SAXTransformerFactory)
tFactory);

      XMLFilter xmlFilter1 = new xmlParse();
      xmlFilter1.setParent(reader);

      XMLFilter xmlFilter2 =
               saxTFactory.newXMLFilter(new
StreamSource("http://localhost/taymac.nsf/dynitmact.xsl"));

      xmlFilter2.setParent(xmlFilter1);

      Serializer serializer = SerializerFactory.getSerializer

(OutputProperties.getDefaultMethodProperties("xml"));

      serializer.setOutputStream(System.out);

      xmlFilter2.setContentHandler(serializer.asContentHandler());

      xmlFilter2.parse(new
InputSource("d:\\notes\\data\\domino\\cgi-bin\\itmact.xml"));

    }

//////////////////////

 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.