-
Bug
-
Resolution: Fixed
-
P2
-
1.1
-
1.1fcs
-
sparc
-
solaris_2.6
-
Verified
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import java.io.*;
import org.w3c.dom.*;
public class T2 {
public static void main(String str[]) throws Exception {
TransformerFactory tf = TransformerFactory.newInstance();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(new File("cities.xsl"));
DOMSource ds = new DOMSource((Node)document);
Transformer t = tf.newTransformer(ds);
}
}
The above program produces the problem. xsl file is attached.
The error thrown is as mentioned below:
javax.xml.transform.TransformerException: "xmlns:xsl" attribute is not allowed on the xsl:stylesheet element!
at org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:843)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:342)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:300)
at org.apache.xalan.processor.ProcessorStylesheetElement.startElement(ProcessorStylesheetElement.java:137)
at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:626)
at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:284)
at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:119)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:207)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:266)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:734)
at org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.java:485)
at SAXTFactoryTest011.main(SAXTFactoryTest011.java:44)
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import java.io.*;
import org.w3c.dom.*;
public class T2 {
public static void main(String str[]) throws Exception {
TransformerFactory tf = TransformerFactory.newInstance();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document document = db.parse(new File("cities.xsl"));
DOMSource ds = new DOMSource((Node)document);
Transformer t = tf.newTransformer(ds);
}
}
The above program produces the problem. xsl file is attached.
The error thrown is as mentioned below:
javax.xml.transform.TransformerException: "xmlns:xsl" attribute is not allowed on the xsl:stylesheet element!
at org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:843)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:342)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:300)
at org.apache.xalan.processor.ProcessorStylesheetElement.startElement(ProcessorStylesheetElement.java:137)
at org.apache.xalan.processor.StylesheetHandler.startElement(StylesheetHandler.java:626)
at org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:284)
at org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:119)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:207)
at org.apache.xalan.processor.TransformerFactoryImpl.processFromNode(TransformerFactoryImpl.java:266)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:734)
at org.apache.xalan.processor.TransformerFactoryImpl.newXMLFilter(TransformerFactoryImpl.java:485)
at SAXTFactoryTest011.main(SAXTFactoryTest011.java:44)