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

XSL, comments and whitespace

Subject: XSL, comments and whitespace
From: "Jean-Luc Mathieu" <jean-luc.mathieu@xxxxxxxxxxxxx>
Date: Mon, 20 Sep 2004 14:58:18 +0200
xsl comments
Hi !
 
I'm trying to use the SAXResult way to get results from a Transformer, and i
have some troubles with comments. I'm using Xalan 2.6.0.
 
I've set up a Transformer, using SAX events as source, and processing results
into a SAXResult (MyHandler implements at least ContentHandler and
LexicalHandler) :

// Simplified code ; checking of next cast is done before
SAXTransformerFactory factory =
((SAXTransformerFactory)TransformerFactory.newInstance());
TransformerHandler transform;
try {
	transform = factory.newTransformerHandler(new
StreamSource("mysheet.xsl"));
}
catch (TransformerConfigurationException problem) {
	problem.printStackTrace();
}
MyHandler out = new MyHandler();
SAXResult result = new SAXResult(out);
result.setLexicalHandler(out);
transform.setResult(result);

In mysheet.xsl, i process input events, and in a template, i use the
<xsl:comment> tag to generate in the output XML comments. All the processing is
working well : the SAX events i get in MyHandler class are the expected results
events, except for the comments. The comment(...) method, implemented from
LexicalHandler, is never called. Is anybody knowns where i am wrong ?

In the same way, i wanted to get notified of ignorable whitespaces in the
result ; this doen't work too, since the ignorableWhitespace(...) method
implemented from ContenHandler is not called too. Can anybody help me to
understand ?

Thanks a lot !
Jean-Luc

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.