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

javax.xml.transform.TransformerException: xsl:styleshe

Subject: javax.xml.transform.TransformerException: xsl:stylesheet is not a llowed in this position in the stylesheet
From: Charles Macleod <cmacleod@xxxxxxxx>
Date: Thu, 6 May 2004 12:17:06 -0700
javax.xml.transform.transformerexception
All,

I am using the Xalan-J TemplatesHandler via
javax.xml.transform.sax.TemplatesHandler. I am (now) parsing an 'empty'xsl
(as a test) with an XMLReader that has the TemplatesHandler set as its
ContentHandler (see code below). 

I keep getting a "javax.xml.transform.TransformerException: xsl:stylesheet
is not allowed in this position in the stylesheet!" error. I stripped
everything out of the xsl leaving only the <xsl:stylesheet> element and I
still get the error. Any ideas? I'm figuring this has to be a configuration
issue with the reader but I really don't have a clue....

Stylesheet:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
</xsl:stylesheet>

Code:
 
TransformerFactory tfac = TransformerFactory.newInstance() ;
SAXTransformerFactory saxTfac = ((SAXTransformerFactory) tfac) ;

TemplatesHandler templatesHandler = saxTfac.newTemplatesHandler() ;

// Create an XMLReader and set its ContentHandler.
SAXParserFactory fac = SAXParserFactory.newInstance() ;
SAXParser parser = fac.newSAXParser() ;
XMLReader reader = parser.getXMLReader() ;
reader.setContentHandler( templatesHandler) ;

// Parse the stylesheet.
reader.parse( args[0]) ; <--- throws exception

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.