Hi, PFA the xsl I have,while running the code I get the following error. Could you please help me slove the problem. Instead of using the src mentioned it uses the default java.lang.
SystemId Unknown; Line #32; Column #144; java.lang.NoSuchMethodException: For extension function, could not find method java.lang.String.setFile([ExpressionContext,] #STRING). SystemId Unknown; Line #32; Column #144; java.lang.NullPointerException file:///D:/GEGDC/SP331826/Internal/rac4TC10/portal/temp/GESharedOpReport.xsl; Line #135; Column #117; java.lang.NoSuchMethodException: For extension function, could not find method java.lang.String.genPDF([ExpressionContext,] #STRING). file:///D:/GEGDC/SP331826/Internal/rac4TC10/portal/temp/GESharedOpReport.xsl; Line #135; Column #117; java.lang.NullPointerException Thanks, Sai.
<?xml version="1.0" encoding="utf-8" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:java="http://xml.apache.org/xalan/java" xmlns:xsltc="http://xml.apache.org/xalan/xsltc" xmlns:lxslt="http://xml.apache.org/xslt" xmlns:imagecache="org.apache.fop.image.FopImageFactory" xmlns:redirect="http://xml.apache.org/xalan/redirect" xmlns:Date="http://xml.apache.org/xalan/java/java.util.Date" xmlns:setfile="com.ge.mfg.rac.cme.sharedopmanager.reports.GESharedopReportXalanExtension" xmlns:generateGDTHtml="com.teamcenter.rac.form.gdt.GenerateGDTHTML" xmlns:pdfgen="com.ge.mfg.rac.cme.sharedopmanager.reports.XMLReportExtension" extension-element-prefixes="redirect setfile generateGDTHtml pdfgen imagecache" version="1.1"> <xsl:import href="GE_MFG_Header.xsl"/> <xsl:import href="GE_MFG_Footer.xsl"/> <lxslt:implements prefix="redirect" elements="write open close " functions=""> <lxslt:script lang="javaclass" src="org.apache.xalan.lib.Redirect"/> </lxslt:implements> <lxslt:implements prefix="pdfgen" elements="genPDF" functions=""> <lxslt:script lang="javaclass" src="com.ge.mfg.rac.cme.sharedopmanager.reports.XMLReportExtension"/> </lxslt:implements> <lxslt:implements prefix="setfile" elements="getCurrentDir setFile setImanFile" functions=""> <lxslt:script lang="javaclass" src="com.ge.mfg.rac.cme.sharedopmanager.reports.GESharedopReportXalanExtension"/> </lxslt:implements> <lxslt:implements prefix="generateGDTHtml" elements="generate" functions=""> <lxslt:script lang="javaclass" src="com.teamcenter.rac.form.gdt.GenerateGDTHTML"/> </lxslt:implements> <xsl:output method="xml" indent="yes" version="1.0" encoding="ISO-8859-1"/> <xsl:variable name="fileName" select="concat('LinkedOperations','.pdf')"/> <xsl:variable name="outDir" select="'D:/GEGDC/SP331826/Internal/rac4TC10/temp/'"/> <!-- <xsl:variable name="outDir1" select="setfile:getCurrentDir()"/> --> <!-- <xsl:variable name="outDir"> <xsl:if test="string-length($outDir1) = '0'"> <xsl:value-of select="'.\'"/> </xsl:if> <xsl:if test="string-length($outDir1) != '0'"> <xsl:value-of select="$outDir1"/> </xsl:if> </xsl:variable> --> <xsl:template match="/OPLINKS"> <!--Emptying the cache memory to get rid of old images to fix the issue of images not getting refreshed--> <!-- <xsl:value-of select="imagecache:resetCache()"/> --> <!-- <xsl:call-template name="copyImages"/> --> <redirect:write file="{$outDir}/output.fo"> <!--Writing to output.fo file starts here--> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <!-- The block of code for filling in the document summary fields ends here --> <fo:layout-master-set> <!-- The template declaration for all the pages of the report starts here --> <fo:simple-page-master master-name="AllPage_template" page-width="297mm" page-height="195mm" margin-right="6mm" margin-left="6mm" margin-top="20mm" margin-bottom=".08in"> <fo:region-body margin-top="20mm" margin-bottom="35mm" margin-left="1mm" margin-right="1mm" border="0.2pt solid black"></fo:region-body> <fo:region-before extent="16mm"/> <fo:region-after extent="25mm"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="AllPage_template"> <xsl:call-template name="headerandfooter"> <xsl:with-param name="caactsec" select="'junk'"/> <xsl:with-param name="page" select="'1'"/> </xsl:call-template> <fo:flow flow-name="xsl-region-body"> <fo:block linefeed-treatment="preserve" white-space-collapse="false" white-space-treatment="preserve"> <xsl:variable name="links" select="/OPLINKS/@Links"/> <xsl:value-of select="$links"/> </fo:block> <fo:table table-layout="fixed" id="last-page" width="280mm"></fo:table> </fo:flow> </fo:page-sequence> </fo:root> </redirect:write> <xsl:call-template name="ConvertToPDF"/> <!--Converting to PDF format--> <html> <!--=======Creating html file==========--> <head> <title>PEAR Migration Report</title> <style> table { border-collapse: collapse; border-spacing: 0pt; width: 100%; empty-cells: show; border-color:#000000; } td { border-style:solid; border-width:0.2pt; border-color:#000000; font-family: Arial, Helvetica, sans-serif; } th { border-style:solid; border-width:0.2pt; border-color:#000000; background-color:#CCCCFF; } </style> </head> <body> <table> <tr> <td colspan="2"> <script language="JavaScript"> var filePath = "<xsl:value-of select="$fileName"/>"; window.open(filePath,'_self'); </script> <!-- PDF File generated: <a href="output.pdf">Output.pdf</a> --> </td> </tr> </table> </body> </html> <!--======HTML file ends here======--> </xsl:template> <!--====Template for converting to PDF======--> <xsl:template name="ConvertToPDF"> <xsl:comment>This variable is created to trigger the PDF generation java program</xsl:comment> <xsl:variable name="triggerPDFGen" select="pdfgen:genPDF(concat($outDir,'output.fo'),concat($outDir,$fileName))"/> </xsl:template> <!-- <xsl:template name="copyImages"> <xsl:variable name="down_16" select="setfile:setFile('com/ge/mfg/rac/cme/sharedopmanager/images/down_16.png', string($outDir))"/> <xsl:variable name="linkedoperations" select="setfile:setFile('com/ge/mfg/rac/cme/sharedopmanager/images/linkedoperations.jpeg', string($outDir))"/> <xsl:variable name="loadall_16" select="setfile:setFile('com/ge/mfg/rac/cme/sharedopmanager/images/loadall_16.png', string($outDir))"/> <xsl:variable name="up_16" select="setfile:setFile('com/ge/mfg/rac/cme/sharedopmanager/images/images/up_16.png', string($outDir))"/> </xsl:template> --> </xsl:stylesheet>
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
