Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using xsl:import but i throws NullPointerException

 
Bikramjit Singh Bajwa
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
I facing a weird problem and need urgent solution. My code and error is below:
<b>Code:</b>
1. XML (Data.xml)
<data>
<item>Hello</item>
</date>
2. XSL (Temp.xsl)
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl utput method="html" />
<xsl:include href="TempInclude.xsl" />
<xsl:template match="Gems">
<xsl:call-template name="firstTemplate" />
</xsl:template>

</xsl:stylesheet>
3. XSL (TempInclude.xsl)
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="firstTemplate">
Help me guys
</xsl:template>
</xsl:stylesheet>
<b>Error:</b>
java.lang.NullPointerException
com.icl.saxon.style.XSLGeneralIncorporate.getIncludedStyleSheet(XSLGeneralIncorporate.java:104)
com.icl.saxon.style.XSLStyleSheet.spliceIncludes(XSLStyleSheet.java:421)
com.icl.saxon.style.XSLStyleSheet.preprocess(XSLStyleSheet.java:346)
com.icl.saxon.PreparedStyleSheet.setStyleSheetDocument(PreparedStyleSheet.java:176)
com.icl.saxon.PreparedStyleSheet.prepare(PreparedStyleSheet.java:133)
com.icl.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:127)
com.icl.saxon.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:79)
org.apache.taglibs.standard.tag.common.xml.TransformSupport.doStartTag(Unknown Source)
org.apache.taglibs.standard.tag.el.xml.TransformTag.doStartTag(Unknown Source)
org.apache.jsp.InfoPackageData_jsp._jspService(InfoPackageData_jsp.java:376)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:320)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

I am accessing all this with the help of JSP and all of my files are placed in the same directory and i am getting the following error. Kindly help me ASAP. I shall be very thankfull to you all.
Chakk de..

 
Bikramjit Singh Bajwa
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Forget to tell you, while including second xsl file into first xsl file. I am getting this error. This is just becaz of including xsl.I guess, i am missing something or anything required ?
Thanks in Advance
Bikram
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you should consider writing your custom javax.xml.transform.URIResolver ?
 
Bikramjit Singh Bajwa
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yuhooooo
I just used latest saxon parser and it starts working.
Any way thanks alot Lasse
Bikram
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic