lok: vcl: fix multiple floatwin removal case more robustly.
[LibreOffice.git] / schema / README
blobf32038ed82c832669f48c6ff5ae44d502e91a3d1
1 schemas that can be used for validating ODF files
3 subdirs:
4 - mathml2: W3C MathML 2.0 XML Schema (needed for Math embedded objects)
5 - odf1.0, odf1.1, odf1.2: official OASIS RelaxNG schemas
6 - odf1.3: current OASIS draft ODF 1.3 RelaxNG schema
7 - libreoffice: draft ODF schema, with additional LO extensions
9 The extension schema in "libreoffice/" is used by all unit tests if
10 --with-export-validation is given, which is the default.
12 Notably this means that if you add a new feature to the ODF filters and you add
13 the required unit test for the new feature, then most likely the test will fail
14 with a complaint from the validator; in this case the schema needs to be
15 updated to contain the new elements and attributes.
17 The extension schema uses the RelaxNG "include" feature to refer to the ODF
18 schema; this means that it only contains those parts of the schema that
19 actually need to be changed - this works well in many cases because the ODF
20 schema is quite well structured with many named patterns, but unfortunately
21 there are a few places where that isn't the case and large chunks needed to be
22 copied to override them.
24 In the easy case, to add an attribute you just want to search for the
25 corresponding element, which will have a "foo-attlist" named pattern, and then
26 add another attribute like this:
28   <rng:define name="draw-enhanced-geometry-attlist" combine="interleave">
29     <rng:optional>
30       <rng:attribute name="drawooo:sub-view-size">
31         <rng:ref name="string"/>
32       </rng:attribute>
33     </rng:optional>
34   </rng:define>
36 Currently only the features that are actually exported in the unit tests have
37 been added to the schema; there is still some work to do here to add
38 everything; the crashtesting script also does ODF validation of all files and
39 now also uses the custom schema.
41 Unfortunately it turned out that there are a lot of extensions already for
42 which no proposal exists [1], and in many cases not even an entry on the Wiki
43 [2], so clearly something like this extension schema is needed.
45 [1] git grep TODO schema/libreoffice
46 [2] https://wiki.documentfoundation.org/Development/ODF_Implementer_Notes/List_of_LibreOffice_ODF_Extensions