Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Incorporating XHTML components into custom Schema by reference

(1) I want to create a custom XML Schema which will contain some custom elements
and some standard XHTML elements, and have both sets of elements be validated
when I run a standard validator. Some XHTML elements, of course, may contain
other XHTML elements as children, which should be just as valid in my custom
Schema. Can this be done (see example) ?

Example XML to be validated:
<foo>
<title>...</title>
<id>...</id>
<xhtml:meta ... />
<bar>
<example>...</example>
<xhtml:p>...<xhtml:em>...</xhtml:em>...</xhtml:p>
</bar>
</foo>

(2) Say now that I want to include an <xhtml:body> element, but I want to
add a few custom children elements that could go inside it--and still be
validated--as shown. Can this be done?

<foo>
<title>...</title>
<id>...</id>
<xhtml:meta ... />
<xhtml:body>
<example>...</example>
<xhtml:p>...<xhtml:em>...</xhtml:em>...</xhtml:p>
</xhtml:body>
</foo>

(3) Assuming there are some problems doing either of the above, how about
this: can I have a structure as in (2) and create a Schema to just validate
my custom elements?
[1374 byte] By [Michael Sorens] at [2007-11-9 15:27:36]