> i am getting the below exception when i apply xslt to xml using saxon. 
 
As others have pointed out, the stack trace makes it very plain that you have loaded Saxon, and the error messages relating to XSLT 2.0 constructs confirm this. 

my code is :


            System.setProperty(
                        "javax.xml.TransformerFactory",
                        "net.sf.saxon.SchemaAwareTransformerFactory");
TransformerFactory tFactory= TransformerFactoryImpl.newInstance();
 
There are several errors here. The system property name is "javax.xml.transform.TransformerFactory". The two possible values for Saxon are "net.sf.saxon.TransformerFactoryImpl" and "com.saxonica.SchemaAwareTransformerFactory". Don't try the schema-aware version until you've got the basics working - it needs a commercial license.
 
Finally (although I'm not sure this matters), if you want to load using the system properties you should use "TransformerFactory.newInstance()". As I mentioned earlier, an alternative is to replace the whole of the above code with
 
TransformerFactory tFactory = new net.sf.saxon.TransformerFactoryImpl();
 
Michael Kay
http://www.saxonica.com


From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of naveen kumar
Sent: 21 August 2007 10:16
To: Mailing list for SAXON XSLT queries
Subject: [saxon] Exception occured when applying xslt to xml

hi,
i am getting the below exception when i apply xslt to xml using saxon.

javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: A node test that matches either NCName:* or QName was expected.
    at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:984)
    at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:788)
    at com.mits.sample.DomSample.main(DomSample.java:37)
Caused by: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: A node test that matches either NCName:* or QName was expected.
    at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:980)
    ... 2 more

my code is :


            System.setProperty(
                        "javax.xml.TransformerFactory",
                        "net.sf.saxon.SchemaAwareTransformerFactory");
TransformerFactory tFactory= TransformerFactoryImpl.newInstance();
            StreamSource stylesheet = new StreamSource(new FileInputStream("style.xsl"));
            Transformer transformer = tFactory.newTransformer(stylesheet);
           
            StreamResult result = new StreamResult(new FileOutputStream("C:/Reports1.xml"));
           
            transformer.transform(xmlDoc,result);