Hi Oleg,
I am new to xsl-fo. I thought I was doing the xsl-fo transformation correctly.
Will you PLEASE explaine me how I should do this?
you have to transform it in xslt to fo objects, like fo:inline rather than
just copying them to the fo.
Thank you
Norm
[EMAIL PROTECTED] wrote:
Hi,
I am attaching the test xsl,xml and the java files. The problem is that
the description of any node
could have tags and text mixed. If I use xsl:value-of (with FOP), I get
only
the text and when I use xsl:copy-of (without FOP embeded), I get the
desired result, but with FOP I
am getting 'error 10231' I have tried everything that I could think of and
could not come up with the
correct stylesheet.
I truly could use your help
I am anxiously waiting for a solution.
Thank you so much in advance.
Norm
--- ERROR -
ERROR 10231 [fop ] (): Unknown formatting object
null^chapter_title
Exception in thread main org.apache.fop.apps.FOPException:
java.lang.NullPoin
erException
at org.apache.fop.apps.Driver.render(Driver.java:486)
at test1.main(test1.java:102)
test.xml --
?xml version=1.0 encoding=iso-8859-1?
?xml-stylesheet type='text/xsl' href='test.xsl'?
document id=DOCUMENT 810-005_103
chapter id=test
chapter_titleTesting Chapter sub3/sub/chapter_title
/chapter
/document
-- test.xsl ---
xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
version=1.0
xmlns:fo=http://www.w3.org/1999/XSL/Format;
xsl:template match=document
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
fo:simple-page-master page-width=200mm master-name=Page1
page-height=280mm
margin-top=10mm margin-bottom=10mm margin-left=20mm
margin-right=20mm
fo:region-body margin-top=0mm margin-bottom=10mm
margin-left=0mm margin-right=0mm/
/fo:simple-page-master
fo:page-sequence-master master-name=PS1
fo:single-page-master-reference master-name=Page1/
/fo:page-sequence-master
/fo:layout-master-set
fo:page-sequence master-reference=Page1
fo:flow flow-name=xsl-region-body
xsl:apply-templates/
/fo:flow
/fo:page-sequence
/fo:root
/xsl:template
xsl:template match=document/chapter/chapter_title
fo:block space-after=3mm font-size=14pt text-align=center
break-before=page
break-after=page
xsl:copy-of select=./
/fo:block
/xsl:template
/xsl:stylesheet
--- test.java file just the main()
public static void main () {
File xmlFile=new File(test.xml);
File xslFile=new File(test.xsl);
File pdfFile=new File(test.pdf);
Logger log = null;
if(log == null) {
Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
log = hierarchy.getLoggerFor(fop);
log.setPriority(Priority.WARN);
}
FileOutputStream OutFile = new
FileOutputStream(pdfFile);
ByteArrayOutputStream out = new
ByteArrayOutputStream();
Driver driver=new Driver();
driver.setLogger(log);
driver.setRenderer(Driver.RENDER_PDF);
InputHandler ih=new XSLTInputHandler(xmlFile,xslFile);
XMLReader p=ih.getParser();
driver.setOutputStream(OutFile);
driver.render(p, ih.getInputSource());
OutFile.close();
}
}//main
__
Your favorite stores, helpful shopping tools and great gift ideas. Experience
the convenience of buying online with [EMAIL PROTECTED]
http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at
http://webmail.netscape.com/