Bug 20453 - FOP ends with error when xsl:include tag used in xsl
Summary: FOP ends with error when xsl:include tag used in xsl
Status: CLOSED INVALID
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: 0.20.4
Hardware: PC All
: P3 major
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-03 15:42 UTC by petrmk
Modified: 2012-04-01 13:49 UTC (History)
0 users



Attachments
Examples of xsd and xsl files used for generating PDF (2.22 KB, application/octet-stream)
2003-06-03 15:45 UTC, petrmk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description petrmk 2003-06-03 15:42:34 UTC
When I put <xsl:include href="testinclude.xsl"> tag in xsl stylesheet, fop ends 
with following error:

[INFO] FOP 0.20.4
[ERROR] null

Fop is used from command prompt:
fop  -xml test.xml -xsl test.xsl -pdf test.pdf

I can send complete examples of test.xsd, if needed.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" 
xmlns:nsdc="http://www.rtf2fo.com/NSDC" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template 
match="nsdc:data">
<fo:root>
....
</fo:root>
</xsl:template>
<xsl:include href="testempty.xsl">
</xsl:stylesheet>
Comment 1 petrmk 2003-06-03 15:45:43 UTC
Created attachment 6614 [details]
Examples of xsd and xsl files used for generating PDF
Comment 2 Jeremias Maerki 2003-06-03 16:02:15 UTC
This is no FOP problem. Your test.xsl is not well-formed.

Change:
<xsl:include href="testempty.xsl">

to:
<xsl:include href="testempty.xsl"/>

If you run into problems like this, run the XSL transformation alone (without 
FOP), check for error messages and check if the output from the XSL 
transformation is the output you expect.

More information here: http://xml.apache.org/fop/faq.html#NullPointerException
Comment 3 Clay Leeds 2003-06-03 18:09:05 UTC
Actually, I believe (respectfully) that the bug is in your XSL. First of all,
the xsl:include tag is not closed (although that may be just a typo). 2ndly,
according to everywhere I've read, (XML Bible, the XSL spec, etc.):

  The xsl:include element is only allowed as a top-level element.

That means it should be something like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:nsdc="http://www.rtf2fo.com/NSDC"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="testempty.xsl"/>
<xsl:template  match="nsdc:data">
<fo:root>
....
</fo:root>
</xsl:template>
</xsl:stylesheet>

Hope this helps!

Web Maestro Clay 
Comment 4 Glenn Adams 2012-04-01 13:49:11 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs