RE: XHTML Modularization and Tables...

Mark:

Here is how we are using the existing XHTML modularization in the 1.1
spec.  We have a concept of "layout files" that are used in our product
to represent the presentation of some content.  Each layout file is a
special hybrid of XHTML and XML.  The XHTML represents the static
portions of the presentation. Interspersed in that are dynamic
instructions (in the form of XML tags defined by us).  
 
The root tag of a layout file is 'layout' (we use a namespace of
'mstrlayout' for all of these new tags).  It can contain just about
anything: #PCDATA, and using the XHTML "hook", %Flow.mix%;.  We have
already added our own non-root tags to Misc.extra.  Our overall approach
is to define our own DTD and include the XHTML 1.1 Flat DTD
(xhtml11-flat.dtd), as per the "XML in a Nutshell" book, by Harold and
Means (Chapter 7).
 
One of the simplest tags is called 'render'.  It is basically a way to
call into another Java class (with the resulting content replacing the
'render' tag).
 
There is a tag to add attributes with dynamically generated values to
the enclosing element (similar in concept to the xsl:attribute element).
 
There is a conditional structure (to include one block of XHTML over
another based on a dynamic condition).
 
Finally, there is a list construct (to introduce iteration into a
template of XHTML content).  Lists typically include calls to embedded
render elements.
 
Overall, the modularization works well.  The problem we have had involve
integrating these dynamic tags into a TABLE structure.  For example,
there is no "hook" to introduce custom tags into a TABLE structure.  The
result is that we've had to undefine all of the TABLE tags
(TABLE/TBODY/THEAD/TFOOT/TR/TH/TD/COL/COLGROUP) and redefine their
contents to include our tags.
 
The most common example would be to define a table with a repeating
number of rows.  Each row has elements which are dynamically generated.

 
We also have to redefine META, SELECT, HTML and TITLE to introduce our
own tags (as Misc.extra is not used here).

Finally, we've had to change the ID attribute from ID to NMTOKEN as our
conditional blocks can have to identical IDs (since only one of the two
blocks is ever added to the output stream).
 
I guess my main questions are:

*	
	Is this approach consistent with the designer's intent for
modularization of XHTML?
*	
	Would it be better to use XML Schemas for this integration of
our custom tags with XHTML?  (I'm not very well versed in schemas).
*	
	Do you anticipate any problems with this approach and the XHTML
2.0 modularization effort?

Thanks,
Glenn

Received on Tuesday, 7 June 2005 14:14:39 UTC