This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes problem with XSL transform Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "problem with XSL transform" Watch "problem with XSL transform" New topic
Author

problem with XSL transform

Mauro B.
Greenhorn

Joined: Aug 08, 2002
Posts: 8
Hi,
I got a problem with XSL transform. using jboss3.0.0 with embedded catalina (tomcat4.0.3)
(I deployed in jboss .../server/myserver/deploy an application .ear with a web module).
My init servlet method tries to compile a stylesheet:
...
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); OK
DocumentBuilder db = dbf.newDocumentBuilder(); OK
String myfilenamexsl = "... "; /*it's correct...*/ OK
Document doc = db.parse(myfilenamexsl); OK
Templates t = TransformerFactory.newInstance().newTemplates(new DOMSource(doc)); EXCEPTION!!
...
(Note: my xsl HAS the version attribute set to 1.0 !!)

javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.transform.Tran
sformerException: stylesheet requires attribute: version
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:243)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:328)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:917)
at ...

---------
javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: stylesheet requires attribute: versio
n
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:239)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:328)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:917)
at ...
---------
javax.xml.transform.TransformerException: stylesheet requires attribute: version
at org.apache.xalan.processor.ProcessorLRE.startElement(ProcessorLRE.java:209)
at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:658)
at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:362)
at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:183)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:229)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:328)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:917)
at ...

---------
javax.xml.transform.TransformerException: stylesheet requires attribute: version
at org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:950)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:400)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:311)
at org.apache.xalan.processor.ProcessorLRE.startElement(ProcessorLRE.java:190)
at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:658)
at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:362)
at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:183)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:229)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:328)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:917)
at ...

---------
; SystemID: file:///E:\jboss-3.0.0_tomcat-4.0.3\bin\javax.xml.transform.dom.DOMSource
; SystemID: file:///E:\jboss-3.0.0_tomcat-4.0.3\bin\javax.xml.transform.dom.DOMSource
javax.xml.transform.TransformerException: stylesheet requires attribute: version
at org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:935)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:400)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:311)
at org.apache.xalan.processor.ProcessorLRE.startElement(ProcessorLRE.java:190)
at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:658)
at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:362)
at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:183)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:229)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:328)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:917)
at ...

---------
javax.xml.transform.TransformerException: stylesheet requires attribute: version
at org.apache.xalan.processor.ProcessorLRE.startElement(ProcessorLRE.java:209)
at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:658)
at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:362)
at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:183)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:229)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:328)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:917)
at ...

---------
javax.xml.transform.TransformerException: stylesheet requires attribute: version
at org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:950)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:400)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:311)
at org.apache.xalan.processor.ProcessorLRE.startElement(ProcessorLRE.java:190)
at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:658)
at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:362)
at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:183)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:229)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:328)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:917)
at ...

---------
; SystemID: file:///E:\jboss-3.0.0_tomcat-4.0.3\bin\javax.xml.transform.dom.DOMSource
; SystemID: file:///E:\jboss-3.0.0_tomcat-4.0.3\bin\javax.xml.transform.dom.DOMSource
javax.xml.transform.TransformerException: stylesheet requires attribute: version
at org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:935)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:400)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:311)
at org.apache.xalan.processor.ProcessorLRE.startElement(ProcessorLRE.java:190)
at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:658)
at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:362)
at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:183)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:229)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:328)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:917)
at ...
 
 
subject: problem with XSL transform
 
Similar Threads
problem with XSL transform
xml prolog
Transforming xml by applying xslt using jaxp1.1 with weblogic server
xsl tokenize issue
"as" attribute is not allowed on the xsl:param element!