Michael Stahl created ODFTOOLKIT-475:
----------------------------------------

             Summary: alidator 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
                 Key: ODFTOOLKIT-475
                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-475
             Project: ODF Toolkit
          Issue Type: Bug
          Components: validator
    Affects Versions: 0.7-incubating
         Environment: commit ea8ca1d46ea9eb132d1b270f1c6e9bd4854c633a
            Reporter: Michael Stahl


 

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

 
{noformat}
/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:
  ----^{noformat}
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:p>}} 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:p>}} 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:p>" 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:p but don't allow character content.

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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to