* Our XHTML5 schema reflects the content model of an HTML5 table.

See http://www.w3.org/TR/html5/tabular-data.html#the-table-element
---
Content model:

In this order: optionally a caption element, followed by zero or more colgroup elements, followed optionally by a thead element, followed optionally by a tfoot element, followed by either zero or more tbody elements or one or more tr elements, followed optionally by a tfoot element (but there can only be one tfoot element child in total).
---

Therefore we see nothing here we could simplify.



* The other XML editor you are using is 100% correct in reporting non-determinist content model defined at line 1157. Hence our comment:

<!-- XERCES: cos-nonambig:
     tfoot violate "Unique Particle Attribution" -->

Indeed, the W3C XML Schema requires deterministic content models under the name of "Unique Particle Attribution" and "Consistent Declaration" rules.



* The "Unique Particle Attribution" rule (hard-to-understand for the schema writer, supposed to ease the implementation of validators by developers) is not implemented by our home made schema validator.

Moreover other schema validators such as Xerces have options to relax this kind of restrictions.

See http://xerces.apache.org/xerces2-j/features.html

(Search for property "http://apache.org/xml/features/validation/schema-full-checking";)

Notice that by default, Xerces *disables* full constraint checking.



* Our XHTML5 schema is open source software, so you are free to modify it to adapt it to the XML editor you are using.





On 02/06/2013 06:35 AM, Leif Halvard Silli wrote:
I have tested the XHTML5 XSD found at
http://www.xmlmind.com/xhtml5_resources.shtml, in another XML editor.
The editor’s validity service complained about a non-determinist
content model defined at line 1157.  And, at that location in the XSD,
there is even a comment which notifies about the issue:

    <!-- XERCES: cos-nonambig:
    tfoot violate "Unique Particle Attribution" -->

Becuase the XSD apparently tries allow<tfoot>  to occur EITHER in the
start of the table, or in the end of the tale (when we look at the DOM
- visually it always occurs at the end.) This is done by including both
<xs:element ref="tfoot"/>  right after the<thead>, as well as a
<xs:element ref="tfoot" minOccurs="0"/>  after last<tbody>.

The issue here is that while HTML4 and XHTML5 allowed the<tfoot>
element to occur at the beginning of<table>  element (after<thead>  but
before<tbody>), HTML5 allows it to occur EITHER at the traditional
location OR *after* the last<tbody>. The two variants cause different
DOMs, but to the user they ought to be identical.

To which degree that breaks the XSD spec, I don't know. But when I
commented out the last (<xs:element ref="tfoot" minOccurs="0"/>), the
schema started to work just fine.

I am not sure that it is necessary that the schema allows<tfoot>  to
occur in both contexts (the one or the other). Per HTML5, it is
semantically equivalent regardless where the tfoot occurs.


--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to