ODF extension elements

Markus Mohrhard markus.mohrhard at googlemail.com
Thu Nov 27 18:35:20 PST 2014


Hey,

so I was just looking through some of out calc issues and found a
surprising validation error. According to odfvalidator the following
snippet is invalid.

    <number:number-style style:name="N125P1" style:volatile="true">
      <loext:text>-</loext:text>
      <loext:fill-character> </loext:fill-character>
      <number:number number:decimal-places="2"
number:min-integer-digits="1" number:grouping="true"/>
      <number:text> SIT </number:text>
    </number:number-style>


It took me some time to understand why it complains but at least to my
understanding that snippet is valid. odfvalidator seems to strip the loext
entries and leaves the - resulting in the following xml snippet:

    <number:number-style style:name="N125P1" style:volatile="true">
      -<number:number number:decimal-places="2"
number:min-integer-digits="1" number:grouping="true"/>
      <number:text> SIT </number:text>
    </number:number-style>

which is of course an invalid xml file.

Now looking at the ODF 1.2 spec about handling of foreign elements we find
the following paragraph:











*If a foreign element has a <text:h> or <text:p> ancestor element, and is a
child element of anelement for which the OpenDocument schema permits the
inclusion of character data, and if theOpenDocument schema permits the
inclusion of character data for all its ancestors up to the<text:p> or
<text:h> element ancestor element, then the element's content may
beinterpreted by conforming OpenDocument consumers, and the document itself
shall be validagainst the OpenDocument schema as if the foreign element's
start- and end-tags or its empty-element-tag are removed.For a foreign
element that occurs at another location, conforming consumers should not
interpretthe element's content, but may preserve its content.*
My interpretation of that paragraph that it is valid to include character
data in foreign elements and that they should be stripped similar to the
xml element. Is my reading of the spec wrong?

Regards,
Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20141128/1e363954/attachment.html>


More information about the LibreOffice mailing list