Re: RESEND: Extending xhtml? How?

On Jan 23, 2004, at 7:00 AM, Brad Cox wrote:

> Its been a week so I thought I'd better resend this. Could someone 
> please respond? I'm still dead in the water on this one and REALLY 
> could use help. See http://virtualschool.edu/ale (Action Learning 
> Environment) for the system I'm building. Thanks!
>
> ------
>
> Hi. Just joined this group after weeks of fruitless struggle. Hope 
> someone here can help with which seems (to me) a common and simple 
> problem.
>
> I simply want to add a number of custom elements to XHTML. The 
> application is a teaching infrastructure in which web pages are 
> authored in xhtml with several custom extensions for specifying 
> form-based questions for the students to answer. These are parsed and 
> managed via java/jdom.

I believe that XHTML 1.0 was not designed to allow custom elements to 
be added to it.  You can use XHTML elements within other documents, but 
there is no mechanism to change the definition of xhtml:body, for 
example, so that it can contain an ile:submission element.

>
> I've attached my best shot to date, which works for my custom stuff, 
> but refuses to attach them to xhtml. I'm pretty sure I'm not even on 
> the right track with the <xsd:any/> stuff, but not sure where the 
> right track is. I suspect <xsd:include> is required, but no idea 
> *what* to include.

What you've done is to allow any element from any namespace to appear 
in several places.  If you had a schema for XHTML 
(http://www.w3.org/TR/xhtml-m12n-schema/schema_module_defs.html), you  
could use an import statement and an appropriate namespace declaration 
to allow you to use XHTML elements and constructs in your schema, so 
you could say <ile:page> can contain specific elements or groups from 
the XHTML schema.
>
> To be clear, what I want is for my custom elements, <textField>, and 
> friends, to be allowed whereever <p>, <b>, etc are allowed in xhtml. 
> Can someone here help? Thanks!
>
> PS: In my world, <page>s live within <task>s, and pages are equivalent 
> to xhtml <body> elements. In other words, <textField>, <p>, <h1>, etc 
> should be allowed inside pages, not tasks.
> -- 

If you want your documents to be annotated XHTML, I believe your only 
options are to use processing instructions or comments which would 
require no schema definitions (and would provide no validation of your 
annotations).

What you are describing appears to be within the scope of XForms 
(http://www.w3.org/MarkUp/Forms/, http://www.w3.org/tr/XForms) which is 
a W3C recommendation.  After you have digested that, that might be a 
better forum for addressing how to design your system.

Received on Friday, 23 January 2004 13:09:20 UTC