I am attempting to upgrade to FOP 0.93 from 0.20.  Unfortunately I am
getting a ValidationException saying I need to put fo:root at the top.
My first element is an xsl element, but the first fo: element is
fo:root.  This is exactly the same format as the examples in the fop
examples package, for example:
fop-0.93/examplesfo/fo-reference/xml2pdf.xsl

Here is the top of my XSL:
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform
<http://www.w3.org/1999/XSL/Transform> "
  xmlns:fo="http://www.w3.org/1999/XSL/Format
<http://www.w3.org/1999/XSL/Format> "
  version="1.0">
 
    <xsl:template match="/">
 
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";
font-family="Times" >
            <fo:layout-master-set>

Here is the error stack trace:
 
Exception in thread "main" javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException: Error: First element must be the
fo:root formatting object. Found (Namespace URI:
"http://www.w3.org/1999/XSL/Transform";, Local Name: "stylesheet")
instead. Please make sure you're producing a valid XSL-FO document.
 at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transform
erIdentityImpl.java:501)
 at FopTest.main(FopTest.java:60)
Caused by: org.apache.fop.fo.ValidationException: Error: First element
must be the fo:root formatting object. Found (Namespace URI:
"http://www.w3.org/1999/XSL/Transform";, Local Name: "stylesheet")
instead. Please make sure you're producing a valid XSL-FO document.
 at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder
.java:292)
 at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
 at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(Transf
ormerIdentityImpl.java:1072)
 at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
 at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
Source)
 at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
 at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scan
RootElementHook(Unknown Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn 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.xalan.transformer.TransformerIdentityImpl.transform(Transform
erIdentityImpl.java:484)
 ... 1 more
---------
org.apache.fop.fo.ValidationException: Error: First element must be the
fo:root formatting object. Found (Namespace URI:
"http://www.w3.org/1999/XSL/Transform";, Local Name: "stylesheet")
instead. Please make sure you're producing a valid XSL-FO document.
 at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder
.java:292)
 at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
 at
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(Transf
ormerIdentityImpl.java:1072)
 at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
Source)
 at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
Source)
 at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
 at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scan
RootElementHook(Unknown Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn 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.xalan.transformer.TransformerIdentityImpl.transform(Transform
erIdentityImpl.java:484)

 

Reply via email to