XSL-FO Validation Error

Having trouble installing Oxygen? Got a bug to report? Post it all here.
bwinspur
Posts: 37
Joined: Tue Nov 25, 2003 3:31 am

XSL-FO Validation Error

Post by bwinspur »

The .fo file listed below works when processed by apache's fop-0.20.5, and produces the expected page, with no error messages.

However, oxygen 2.x on eclipse produces the following error on an attempt to validate the file, with the error icon positioned at the root element.

cvc-elt.1: Cannot find the declaration of element 'root'.

==================
<?xml version="1.0" encoding="utf-8"?>
<root xmlns="http://www.w3.org/1999/XSL/Format">
<layout-master-set>
<simple-page-master margin-bottom="1.0in" margin-left="1.0in" margin-right="1.0in"
margin-top="l.0in" master-name="simple" page-height="11.0in" page-width="8.0in">
<region-body margin-top="1.0in"/>
<region-before extent="1.0in"/>
<region-after extent="0.6in"/>
</simple-page-master>
</layout-master-set>
<page-sequence master-reference="simple">
<flow flow-name="xsl-region-body">
<block font-size="12pt" line-height="15pt">
<block>A Brief History</block>
<block>Of</block>
<block>Thyme</block>
</block>
</flow>
</page-sequence>
</root>
==================

Specifying a namespace prefix in line 2 (xmlns:fo=http....), instead of making format the default namespace, does not prevent the validation error.

Although I dont suspect a file coding error on my part, given that the file produces the expected output when processed by the downloaded-from-apache fop, have I missed something ? Where is the diagnostic coming from ?

Bill.
Bill W.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Bill,

There are two checks that can be performed on an XML document. The most important is the well formed check. Without passing this check a document cannot be considered XML. The second check is validation and here there are a lost of schemas one can validate against.

In your case you are trying to perform a validation check without specifying a schema or a DTD. However your document is wellformed and the FOP does not require more, that is why you are able to transform it.

For instance if you choose "New from templates" and select "Formatting Objects with RenderX extensions" you will get something like

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fo:root SYSTEM "http://www.renderx.com/Tests/validator/fo.dtd">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="">
<fo:region-body></fo:region-body>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="">
<fo:flow flow-name="">
<fo:block></fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
which you will be able to validate without problems.

Best Regards,
George
bwinspur
Posts: 37
Joined: Tue Nov 25, 2003 3:31 am

Post by bwinspur »

Thanks George, that explains why my editor has been un-insightful. Incidentally, when I go to 'New from templates', under eclipse, all I see is my project directory.

When writing an xsl doc to gen another markup syntax (e.g. fo syntax), is there a way to have the editor give code assistance for both syntaxes in the same doc ?

Can you direct me to an example of an xml catalog, as referenced in the XML Catalog section of preferences-help.?
Bill W.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Bill,
bwinspur wrote:Thanks George, that explains why my editor has been un-insightful. Incidentally, when I go to 'New from templates', under eclipse, all I see is my project directory.
That is the first step, you should select the file you want to create then if you press the Next button you should get the list of templates.
bwinspur wrote: When writing an xsl doc to gen another markup syntax (e.g. fo syntax), is there a way to have the editor give code assistance for both syntaxes in the same doc ?
Yes this is possible. You can specify XHTML, FO or choose any DTD or XML Schema for the target document and when you will edit an XSL the elements from your target document will be offered whenever an xsl:element is allowed. See the preferences code insight XSL dialog.
bwinspur wrote: Can you direct me to an example of an xml catalog, as referenced in the XML Catalog section of preferences-help.?
The docbook and tei directories contain catalog files. See docbook/catalog.xml and tei/dtd/catalog.xml from your oxygen installation directory.

Best Regards,
George
Post Reply