my dog learned polymorphism*
The moose likes XML and Related Technologies and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark ""as" attribute is not allowed on the xsl:param element!" Watch ""as" attribute is not allowed on the xsl:param element!" New topic
Author

"as" attribute is not allowed on the xsl:param element!

Mukesh Sejwal
Greenhorn

Joined: Apr 26, 2011
Posts: 6
I am using the following jar files for transforming xslt and generating the PDF
avalon-framework-4.2.0.jar
batik-all-1.7.jar
commons-io-1.3.1.jar
commons-logging-1.0.4.jar
fop-hyph.jar
serializer-2.7.0.jar
xalan-2.7.0.jar
xercesImpl-2.7.1.jar
xml-apis-1.3.04.jar
xml-apis-ext-1.3.04.jar
xmlgraphics-commons-1.4.jar

but the following error occurred, Please resolved....


FOP ExampleXML2PDF

...snip...

; SystemID: file:///D:/vp/./xml/xslt/test.xsl; Line#: 6; Column#: 67
; SystemID: file:///D:/vp/./xml/xslt/test.xsl; Line#: 6; Column#: 67
javax.xml.transform.TransformerException: "as" attribute is not allowed on the xsl:param element!
at org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:951)
at org.apache.xalan.processor.StylesheetHandler.error(StylesheetHandler.java:994)
at org.apache.xalan.processor.XSLTElementProcessor.setPropertiesFromAttributes(XSLTElementProcessor.java:365)
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)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:788)
at com.mnyl.scopp.fop.XML2PDF.getPdfFile(XML2PDF.java:90)
at com.mnyl.scopp.fop.XML2PDF.main(XML2PDF.java:45)



*********XSLT File*******







*******XML File*************

<?xml version="1.0" encoding="UTF-8"?><STATUS><ST><player>Amit</player><run>50</run><balls>55</balls><srate/></ST><ST><player>Brij</player><run>55</run><balls>54</balls><srate/></ST><ST><player>C.Sharma</player><run>20</run><balls>50</balls><srate/></ST><ST><player>Dinesh</player><run>90</run><balls>100</balls><srate/></ST><ST><player>E.Mohit</player><run>36</run><balls>36</balls><srate/></ST><ST><player>Fardin</player><run>42</run><balls>30</balls><srate/></ST></STATUS>

Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4467
    
    8

Hi Mukesh. Welcome to The Ranch!

I'm not sure you needed to post quite that much to demonstrate the problem . But anyway...I'm not 100% sure, but I think the "as" attribute on an xsl:param tag is an XSLT2.0 feature, and Xalan 2.7.0 only supports XSLT1.0.

(This is based on content from xsl:param spec in XSLT1.0, XSLT2.0, and the Xalan site).

As to how to fix it...I suppose the obvious thing to try is either removing the unwanted attributes or finding an XSLT processor that supports it (sorry, I don't have a suggestion there, but you can probably find one if you search).

(Edit: hope you don't mind, I've edited the post to make it more readable. I don't think the rest of the content is needed to identify the problem - but I'll put it back if it turns out that's wrong).
Mukesh Sejwal
Greenhorn

Joined: Apr 26, 2011
Posts: 6
Hi Matthew. Thanks a lot..

I resolved the issue by using saxonb9-1-0-8j.zip (contains -- saxon9.jar, saxon9-dom4j.jar, saxon9-dom.jar, saxon9-jdom.jar, saxon9-s9api.jar, saxon9-sql.jar, saxon9-xom.jar, saxon9-xpath.jar, saxon9-xqj.jar), but when I implementing chart i have got new error related to this. I am using Altova Stylevision 2011...


log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry).
log4j:WARN Please initialize the log4j system properly.
FOP ExampleXML2PDF

Preparing...
Transforming...Wed Apr 27 11:29:52 GMT+05:30 2011
Error at xsl:sequence on line 166 column 110 of test.xsl:
XPST0017: XPath syntax error at char 68 on line 166 in {...( $altova:ext-chart-setting...}:
Cannot find a matching 1-argument function named
{http://www.altova.com/xslt-extensions}create-chart-config-from-xml()
Error at xsl:sequence on line 170 column 146 of test.xsl:
XPST0017: XPath syntax error at char 93 on line 170 in {...layer), ($XML/STATUS/ST/run...}:
Cannot find a matching 3-argument function named
{http://www.altova.com/xslt-extensions}create-chart-data-series()
Error at xsl:sequence on line 175 column 149 of test.xsl:
XPST0017: XPath syntax error at char 96 on line 175 in {...yer), ($XML/STATUS/ST/balls...}:
Cannot find a matching 3-argument function named
{http://www.altova.com/xslt-extensions}create-chart-data-series()
Error at xsl:variable on line 178 column 179 of test.xsl:
XPST0017: XPath syntax error at char 114 on line 178 in {...:nodeChartDataset1), false(...}:
Cannot find a matching 3-argument function named
{http://www.altova.com/xslt-extensions}create-chart()
Error at xsl:variable on line 179 column 322 of test.xsl:
XPST0017: XPath syntax error at char 182 on line 179 in {...'sv_chart', 1, 1, '' ), '.p...}:
Cannot find a matching 4-argument function named
{http://www.altova.com/xslt-extensions}generate-auto-number()
Error at xsl:variable on line 182 column 215 of test.xsl:
XPST0017: XPath syntax error at char 142 on line 182 in {...thPx, $altova:nChartHeightP...}:
Cannot find a matching 4-argument function named
{http://www.altova.com/xslt-extensions}save-chart-image()
javax.xml.transform.TransformerConfigurationException: Failed to compile stylesheet. 6 errors detected.
at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:176)
at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:139)
at net.sf.saxon.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:91)
at com.mnyl.scopp.fop.XML2PDF.getPdfFile(XML2PDF.java:90)
at com.mnyl.scopp.fop.XML2PDF.main(XML2PDF.java:45)


Please resolved....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: "as" attribute is not allowed on the xsl:param element!