FO Error - Root element must be root...

Here should go questions about transforming XML with XSLT and FOP.
Sollitaire
Posts: 4
Joined: Mon Mar 13, 2006 5:18 pm

FO Error - Root element must be root...

Post by Sollitaire » Wed Mar 29, 2006 7:37 pm

SystemID: assign4.xml
Description: The process 'FOP' ended with code : 2 The error was : [ERROR] file:assign4.xml_fo:5:10 Root element must be root, not WebSite


What would be the cause of this error? I've seen similar errors on several other websites but no one seems to have one solution for it and none of the solutions I've found apply to me (someone using <Oxygen>). The root element of my XML document has to be WebSite to validate against my dtd so to me (someone relatively new to all of this) this doesn't make much sense.

I'm in Oxygen 7.1 on a Mac transforming an XML doc with related XSL stylesheet that is using FO tags.

Radu
Posts: 6507
Joined: Fri Jul 09, 2004 5:18 pm

Post by Radu » Thu Mar 30, 2006 9:12 am

Hi,

The FO processor that ultimately creates the PDF file is applied in the last stage of the transformation on the result obtained by applying the XSL stylesheet over the XML file.
There is no problem if the root of your XML document is not "root" but the root of the result document obtained by applying the stylesheet deffinitely needs to be "root".
To pinpoint your problem you can first apply the stylesheet over the XML file without FO processing and save the result file with the "fo" extension (like "result.fo"), open and validate it. It is this result document that the FO processor has trouble interpreting (most probably because it is not a valid FO file).

Hope this helps,
Regards, Radu.

Post Reply