Apache OpenOffice (AOO) Bugzilla – Issue 59597
XML Schema definition against which addons.xcu files can be validated?
Last modified: 2017-05-20 09:32:10 UTC
I've been looking for a schema (XML Schema datatypes are used, so I guess an XML Schema definition would be most likely) against which I can validate addons.xcu files. In section 4.7.3 of the Developer's Guide, there's something that looks schema-ish, but is not a schema, under the sentence: "The schema of the configuration branch org.openoffice.Office.Addons specifies how to define a user interface extension." I also found some XML Schema defs on the page <http://util.openoffice.org/common/configuration/oor-document-format.html> but they relate to OOo's registry which seems unrelated to add-ons.
i am not sure if your search simply the Addon.xcs file which can be found in your office installation under <office_root>\share\registry\shema\org\openoffice\Office\Addons.xcs
i guess this issue is about the fact that the xml schema is not fully explained in one document. adding myself to cc.
Jsc, thank you for pointing me to the Addons.xcs file. I am not well-versed in XML Schema, but would like to be able to validate my addons.xcu files against a schema (RelaxNG, with which I'm better acquainted, would be fine as well) manually and, possibly, later automate the process so that I could programmatically generate add-ons with valid xcu files. There are some differences between the file: <office_root>\share\registry\shema\org\openoffice\Office\Addons.xcs and the "schema" given in the Developer's Guide. At first glance, these differences seem to be mainly/only the presence, in the document in the registry, of <info> elements with <descr> child elements. Why the difference? To make the Dev Guide more readable? Neither the DevGuide schema nor the one from OOo's registry validate as XML Schema (I'm checking them with the Eclipse oXygen XML plugin). For the DevGuide document, the complaints revolve around the root element - not being <xsd:schema> and the root element that is present,<oor:component-schema>, being prefixed with a namespace other than the XML Schema namespace and <oor:component-schema> not being a valid root element period. For the document preent in OOo's registry, oXygen XML gives me the same complaints followed by as many errors as there are info/descr element pairs: "Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation' [...]" Are these XML Schema definitions (as in <http://www.w3.org/XML/Schema>) that are just a little broken or are they non-XML-Schema schemas that happen to use the XML Schema datatypes? The tool also shows a lot of (different) errors for the schemas on <http://util.openoffice.org/common/configuration/oor-document-format.html>, though they start off with xs:schema. As I said, I'm not well-acquainted with XML Schema and I am probably relying too much on a tool to check out these schemas, but, by all accounts, oXygen XML is widely used and seems to be pretty trustworthy. Thanks for your help.
the xcs file is more configuration specific and probably not usable for validation with normal xml tools. But it is an interesting idea to create a real xml schema for this purpose. I've discussed it with Stephan Bergmann who had the idea to create a schema for xcs and xcu files so that both kind of files can be validated with existing xml tools. Specilaized schemas for addons or whatever are imaginable as well.
Having a XML Schema definition for the xcu format would be extremely helpful, especially, I think, to people like me who are just starting to try their hand at add-on development. The ability to quickly and painlessly (and automatically) validate an xcu file would help people to catch any obvious/"dumb" mistakes and give them confidence in moving forward. Is there any way that we encourage Mr. Bergmann to take a look at this?
of course, he is sitting vis a vis from me ;-) I forward this issue to him and cc me because i am interested in this issue as well
The OOo CVS contains XML Schema for both .xcs (at officecfg/registry/component-schema.xsd) and .xcu (at officecfg/registry/component-update.xsd) files. I hope that suits your needs (even though an addon.xcu could be considered a restricted form of a general .xcu file, so that component-update.xsd could be considered too broad for your specific needs). If, however, there are any problems with those .xsd files, then please open a new issue.
Most recent comment refers to a schema definition in CVS. But I see no schema at that location in SVN. So I'm opening this as an enhancement request.
(In reply to comment #8) > Most recent comment refers to a schema definition in CVS. But I see no > schema at that location in SVN. So I'm opening this as an enhancement > request. Comment 7 from Stephan gives you the clue: DTDs are located in main/officecfg/registry/
Schemas are located here: https://svn.apache.org/repos/asf/incubator/ooo/trunk/main/officecfg/registry/