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

RE: SAX Transformation: Servlet returns blank XSL temp

Subject: RE: SAX Transformation: Servlet returns blank XSL template
From: "Paul Brown" <prb@xxxxxxxxxxxxx>
Date: Wed, 9 Oct 2002 23:05:45 -0400
servlet sax xml filter
> -----Original Message-----
> From: Bruce McDougald [mailto:bmcdougald@xxxxxxxxxxx]
>     if (tFactory.getFeature(SAXSource.FEATURE) &&
> tFactory.getFeature(SAXResult.FEATURE))

One comment that doesn't answer your question: the feature that you're after isn't either of those above.  You actually want to test SAXTransformerFactory.FEATURE (to see if the cast will succeed) and SAXTransformerFactory.FEATURE_XMLFILTER (to see if the newXMLFilter(...) methods are supported.

The problem with your servlet is in the XMLFilter.  A couple of comments:

1) Unless you're explicitly configuring the namespace properties for the driving XMLReader (and are sure that no one else is going to change them), using QName to drive logic is a Bad Idea.  For instance, with some namespace property settings, you're not even guaranteed to get a QName parameter.

2) You do not want the static on the fields in the XMLFilter.  You should use non-static fields, overload the parse(...) methods, and perform any necessary initialization there.  (This is the reason that you're getting the strange behavior on the second pass.  Look up the meaning of the static keyword in the Java language specification; section 8.3.1.1 for static Fields.)

You should come on over to the SAX users list (sax-users@xxxxxxxxxxxxxxxxxxxxx) and post your XMLFilter code there for help and some pointers.

	-- Paul

 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.