Hi Jos, On 05.03.2011 11:24, Jos van den Oever wrote:
201103051124.50794.jos@vandenoever.info type= cite > Hi all, I've been working on some software to check style names and style references in ODF documents. During this work, the question arose: May automatic styles defined in styles.xml be referenced from content.xml? I've been digging through the specification versions to find an answer and strictly speaking it seems to be allowed since 1.2. Well, at least the intention was that automatic styles in styles.xml cannot be referenced from content.xml. Why? Document styles are stored in a separate file because it is a common tasks to replace them with a different set of styles. That's much easier and much faster (from the perspective of I/O and CPU cycles) if they are separate from the content, because the content has not to be touched for this purpose. However, exchanging styles in styles.xml is only a simple task if the automatic styles that are used in styles.xml are not referenced in content.xml. If they are referenced in content.xml, one would either has to analyze which automatic styles are referenced outside styles.xml, or would have to keep all of them.
201103051124.50794.jos@vandenoever.info type= cite > For font-face-declarations a similar question can be asked. Right. See below.
201103051124.50794.jos@vandenoever.info type= cite > ODF 1.2 public review draft 3 The <office:document-content> root element contains document content and automatic styles used in a document. The file within the package for the <office:document-content> element is content.xml. The <office:document-styles> root element contains styles used in document content and automatic styles used in styles. The file within the package for the <office:document-styles> element is styles.xml. Styles and font face declarations are referenced by their style:name attribute. A referenced style or font face declaration should be defined in the same file as the reference, or in styles.xml. This means that content.xml may reference fonts in styles.xml, doesn't it?
201103051124.50794.jos@vandenoever.info type= cite > For automatic styles, the name may be generated by OpenDocument producers. For each style family or style element, producers should generate distinct sets of names for automatic styles stored in the content.xml 3.1.3.2 and styles.xml 3.1.3.3 files. The names should also be distinct from the names used in the <office:styles> element inside the styles.xml files. Does this mean that a name for an automatic style of a certain family in content.xml must be distinct from the name of an automatic style of the same family in styles.xml? Its a should rather than a shall or must . So, yes the names should be distinct, but they don't have to.
201103051124.50794.jos@vandenoever.info type= cite > From the 1.0 and 1.1 specification, it appears that it is not allowed for automatic styles defined in styles.xml to be referenced from content.xml. But the 1.2 specification is less clear to me on this subject. Do you have a suggestion where we should be clearer? If so, please don't hesitate to enter an ODF 1.3 JIRA issue for this. Best regards Michael -- Michael Brauer Oracle Office Development Phone: +49 40 23646 500 Oracle Office Global Business Unit ORACLE Deutschland B.V. & Co. KG Nagelsweg 55 20097 Hamburg ORACLE Deutschland B.V. & Co. KG Hauptverwaltung: Riesstr. 25, D-80992 München Registergericht: Amtsgericht München, HRA 95603 Komplementärin: ORACLE Deutschland Verwaltung B.V. Rijnzathe 6, 3454PV De Meern, Niederlande Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697 Geschäftsführer: Jürgen Kunz, Marcel van de Molen, Alexander van der Ven Oracle is committed to developing practices and products that help protect the environment