Hello!
I am working on a xml schema for a custom xml based template system. Similar to XSL, control statements like "foreach" or "if" are supported.
But I got stuck to make the following xml snippet valid:
<html:table
xmlns="http://www.my-site.com/xsd/template/control/1.0"
xmlns:html="http://www.w3.org/1999/xhtml">
<foreach var="row" in="rows">
<html:tr>[...]</html:tr>
</foreach>
</html:table>
As defined in the XHTML schema, no other children than "tr" (and some others) are allowed for the table element.
But how can I define the "foreach" element as "transparent" in my custom schema, so that the document will be valid?
I have already discovered a
XML schema for XSL[
^], but even after copying the relevant parts (the for-each element and its dependencies) it does not work (Visual Studio still complains: The element 'table' in namespace 'http://www.w3.org/1999/xhtml' has invalid child element 'foreach' in namespace 'http://www.my-site.com/xsd/template/control/1.0'. List of possible elements expected: 'caption, col, colgroup, thead, tfoot, tbody, tr' in namespace 'http://www.w3.org/1999/xhtml').
My current schema can be found
here.
Thanks in advance and in hope there is a solution,
Henning