Uploaded image for project: 'ODF Toolkit'
  1. ODF Toolkit
  2. ODFTOOLKIT-475

validator applies ODF 1.1 rules to ODF 1.2 documents when checking character content in foreign elements, part 2: ODF elements that don't allow character content

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.7-incubating
    • 0.7-incubating
    • validator
    • None
    • commit ea8ca1d46ea9eb132d1b270f1c6e9bd4854c633a

    Description

       

      The ODF validator (with -e) complains because the ForeignContentFilter assumes that every element below a text/text:h allows character content, but the schema does not allow it in some cases.

       

      /tmp/libtest_sw_odfexport.soxnqrfr.tmp/content.xml[2,4087]: Error: unexpected character literal
      tials>I</loext:sender-initials><text:p>bar</text:p></office:annotation><office:
        ----^

      Here the foreign "loext:sender-initials" is inside <office:annotation>, which does not allow character content.

      ODF 1.2 part 1 3.17 says:

      If a foreign element has a <text:h> or <text> ancestor element, and is a child element of an element for which the OpenDocument schema permits the inclusion of character data, and if the OpenDocument schema permits the inclusion of character data for all its ancestors up to the <text> or <text:h> element ancestor element, then the element's content may be interpreted by conforming OpenDocument consumers, and the document itself shall be valid against the OpenDocument schema as if the foreign element's start- and end-tags or its empty-element-tag are removed.

       

      Note the "for all its ancestors up to the <text>" part; in the example above the validator should assume that the character content in the foreign element will be ignored by consumers.

      So the ForeignContentFilter needs to detect these elements that occur in a text but don't allow character content.

      Have a patch for this, will push to github once i figure out how...

      Attachments

        Activity

          People

            Unassigned Unassigned
            mistmist Michael Stahl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: