OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

office message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [office] May automatic styles defined in styles.xml be referenced from content.xml?

On Friday, March 18, 2011 16:21:55 pm MICHAEL BRAUER wrote:
> Hi Jos,
> On 05.03.2011 11:24, Jos van den Oever wrote:
> > 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.
> > For font-face-declarations a similar question can be asked.
> Right. See below.
> > 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?
Yes, it does. The latest stable version of LibreOffice that I use saves the same 
font face declarations under the same name in both content.xml and styles.xml. 
Given the above sentence, this should not be allowed. If it would be allowed, 
the document should state in what order the styles of a given name are to be 
used, i.e. should the definition in content.xml or the one in styles.xml be 
used. I think it would be best to simply say that the names must be distinct.

> > "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 and styles.xml 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.
Since these are separate groups of style names, it does no harm to have the 
same name re-used.

> >  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.

Would this be 1.3 or a 1.2 errata?


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]