naveen kumar
2007-08-21 09:26:54 UTC
Even though irectified the previous exception by giving valid x path
exception i am getting the below exception
Caused by: javax.xml.transform.TransformerException: Could not find
function: current-group
at org.apache.xalan.processor.XSLTAttributeDef.processEXPR(
XSLTAttributeDef.java:803)
at org.apache.xalan.processor.XSLTAttributeDef.processValue(
XSLTAttributeDef.java:1398)
at org.apache.xalan.processor.XSLTAttributeDef.setAttrValue(
XSLTAttributeDef.java:1589)
at
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(
XSLTElementProcessor.java:381)
at
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(
XSLTElementProcessor.java:312)
at org.apache.xalan.processor.ProcessorTemplateElem.startElement(
ProcessorTemplateElem.java:122)
at org.apache.xalan.processor.StylesheetHandler.startElement(
StylesheetHandler.java:668)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(
TransformerFactoryImpl.java:972)
My code is :
\
System.setProperty(
"javax.xml.TransformerFactory",
"net.sf.saxon.TransformerFactoryImpl");
StreamSource xmlDoc = new StreamSource(new FileInputStream("
catalog.xml"));
//TransformerFactory tFactory = TransformerFactory.newInstance
();
TransformerFactory tFactory= TransformerFactory.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);
exception i am getting the below exception
Caused by: javax.xml.transform.TransformerException: Could not find
function: current-group
at org.apache.xalan.processor.XSLTAttributeDef.processEXPR(
XSLTAttributeDef.java:803)
at org.apache.xalan.processor.XSLTAttributeDef.processValue(
XSLTAttributeDef.java:1398)
at org.apache.xalan.processor.XSLTAttributeDef.setAttrValue(
XSLTAttributeDef.java:1589)
at
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(
XSLTElementProcessor.java:381)
at
org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(
XSLTElementProcessor.java:312)
at org.apache.xalan.processor.ProcessorTemplateElem.startElement(
ProcessorTemplateElem.java:122)
at org.apache.xalan.processor.StylesheetHandler.startElement(
StylesheetHandler.java:668)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(
TransformerFactoryImpl.java:972)
My code is :
\
System.setProperty(
"javax.xml.TransformerFactory",
"net.sf.saxon.TransformerFactoryImpl");
StreamSource xmlDoc = new StreamSource(new FileInputStream("
catalog.xml"));
//TransformerFactory tFactory = TransformerFactory.newInstance
();
TransformerFactory tFactory= TransformerFactory.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);