Page 1 of 1

Validation xsl-fo - allowing additional attributes

Posted: Fri Jan 30, 2009 9:32 pm
by matisse
We have defined some of our own custom fo attributes and would like oXygen to not report these as invalid.

For example we want to be able to have:

Code: Select all

   <fo:block me:class="Heading1">
We add our xmlns for the "me" namespace to the fo:root element like this

Code: Select all


  <fo:root
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:rx="http://www.renderx.com/XSL/Extensions"
xmlns:me="http://www.matisse.net/2009/XSL/Format"
>

We have also tried adding a .xsd file inside frameworks/fo/xsd/
and editing the frameworks/fo/xsd/fo.xsd file, but oXygen does not seem to use those files for validation.

So, we are wondering how we can extend the list of valid attributes that the oXygen validator is using?

Re: Validation xsl-fo - allowing additional attributes

Posted: Fri Jan 30, 2009 10:21 pm
by george
By default oXygen uses a FO Editor for .fo files. You need to use the XML Editor to get the FO framework get used. For that just go to Options->Preferences -- File Types and add an entry with

fo as extension
XML Editor as editor

Then you will get the XML Editor used for opening .fo files and if you make the Information view visible (Perspective->Show View->Information) then you should be able to see that the schema from frameworks/fo is used for validation.

Now, you can either change that schema or just edit the FO framework and specify your schema. For editing the framework go to Options->Preferences -- Document Type Association, make sure you set the User role to Developer and then edit the FO document type and on the Schema tab specify the Schema URI to point to your schema.

If you encounter difficulties let us know.

Best Regards,
George

Re: Validation xsl-fo - allowing additional attributes

Posted: Sat Jan 31, 2009 9:12 pm
by matisse
george wrote:By default oXygen uses a FO Editor for .fo files. You need to use the XML Editor to get the FO framework get used.
Thank you!

We've done a little experiment and that seems to work.

Re: Validation xsl-fo - allowing additional attributes

Posted: Sun Feb 01, 2009 2:18 am
by matisse
What is the role of the file

Code: Select all

{oxygen}/frameworks/fo/xsd/catalog.xml
? Is it used for auto-completion feature while editing?

Here's what is in the catalog.xsd file in my version of oXygen (9.3)

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<!--
Comment the DTD declaration to avoid looking for it on the web.
Alternatively we can place a copy of the DTD locally and refer to it.
-->
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<system systemId="http://www.w3.org/1999/XSL/Format/xsd/fo.xsd" uri="fo.xsd"/>
<system systemId="http://www.w3.org/1999/XSL/Format/xsd/rxxsd.xsd" uri="rxxsd.xsd"/>
</catalog>

Re: Validation xsl-fo - allowing additional attributes

Posted: Mon Feb 02, 2009 12:37 pm
by sorin_ristache
Hello,

It is an XML catalog used by the validation action that maps the remote schemas fo.xsd and rxxsd.xsd to the local files with the same name. These mappings replace fetching the remote files from the Web with reading the local files which speeds up the validation action. This is the purpose of XML catalog files in general.


Regards,
Sorin