W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2011

Extended XHTML schema

From: Thomas Urban <thomas.urban_ext@uid.com>
Date: Mon, 17 Oct 2011 07:24:12 +0000
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <D09BF88D98147A4E9FEC1FC8C84610F32A13A4@s12.uid.local>
Hi,


I'm trying to extend XHTML schema by redefining it's base XSD file in a new XSD declaring extra elements to extend XHTML. I'm currently stuck with declaring a single element (called "extradata" here) to mandatorily appear as last child node of xhtml:body. Here is (a reduced copy of) my XSD file's content:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.w3.org/1999/xhtml"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns="http://www.w3.org/1999/xhtml"
      elementFormDefault="qualified">

      <xs:redefine schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
            <xs:group name="xhtml.body.content">
                  <xs:sequence>
                        <xs:group ref="xhtml.body.content"/>
                        <xs:element name="extraData" minOccurs="1" maxOccurs="1" type="xs:string"/>
                  </xs:sequence>
            </xs:group>
      </xs:redefine>
/xs:schema>

Validating an XHTML file including element extraData as last child of xhtml:body the following 2 errors are encountered by Java's DocumentBuilder:

2011-10-14 18:12:11     ERROR   Public ID: null Line : 2 Message: cvc-complex-type.2.4.a: Invalid content was found starting with element 'extraData'. One of '{"http://www.w3.org/1999/xhtml":h1, "http://www.w3.org/1999/xhtml":h2, "http://www.w3.org/1999/xhtml":h3, "http://www.w3.org/1999/xhtml":h4, "http://www.w3.org/1999/xhtml":h5, "http://www.w3.org/1999/xhtml":h6, "http://www.w3.org/1999/xhtml":ul, "http://www.w3.org/1999/xhtml":ol, "http://www.w3.org/1999/xhtml":dl, "http://www.w3.org/1999/xhtml":p, "http://www.w3.org/1999/xhtml":div, "http://www.w3.org/1999/xhtml":pre, "http://www.w3.org/1999/xhtml":blockquote, "http://www.w3.org/1999/xhtml":address, "http://www..w3.org/1999/xhtml":hr, "http://www.w3.org/1999/xhtml":table, "http://www.w3.org/1999/xhtml":form, "http://www.w3.org/1999/xhtml":fieldset, "http://www.w3.org/1999/xhtml":br, "http://www.w3.org/1999/xhtml":span, "http://www.w3.org/1999/xhtml":em, "http://www.w3.org/1999/xhtml":strong, "http://www.w3..org/1999/xhtml":dfn, "http://www.w3.org/1999/xhtml":code, "http://www.w3.org/1999/xhtml":samp, "http://www.w3.org/1999/xhtml":kbd, "http://www.w3.org/1999/xhtml":var, "http://www.w3.org/1999/xhtml":cite, "http://www.w3.org/1999/xhtml":abbr, "http://www.w3.org/1999/xhtml":acronym, "http://www.w3.org/1999/xhtml":q, "http://www.w3.org/1999/xhtml":tt, "http://www.w3.org/1999/xhtml":i, "http://www.w3.org/1999/xhtml":b, "http://www.w3.org/1999/xhtml":big, "http://www.w3.org/1999/xhtml":small, "http://www.w3.org/1999/xhtml":sub, "http://www.w3.org/1999/xhtml":sup, "http://www.w3.org/1999/xhtml":bdo, "http://www.w3.org/1999/xhtml":a, "http://www.w3.org/1999/xhtml":img, "http://www.w3.org/1999/xhtml":map, "http://www.w3.org/1999/xhtml":object, "http://www.w3.org/1999/xhtml":input, "http://www.w3.org/1999/xhtml":select, "http://www.w3.org/1999/xhtml":textarea, "http://www.w3.org/1999/xhtml":label, "http://www.w3.org/1999/xhtml":button, "http://www.w3.org/1999/xhtml":ruby, "http://www.w3.org/1999/xhtml":ins, "http://www.w3.org/1999/xhtml":del, "http://www.w3.org/1999/xhtml":script, "http://www.w3.org/1999/xhtml":noscript}' is expected.
2011-10-14 18:12:11     ERROR   Public ID: null Line : 2 Message: cvc-complex-type.2.4.b: The content of element 'body' is not complete. One of '{"http://www.w3.org/1999/xhtml":h1, "http://www.w3.org/1999/xhtml":h2, "http://www.w3.org/1999/xhtml":h3, "http://www.w3.org/1999/xhtml":h4, "http://www.w3..org/1999/xhtml":h5, "http://www.w3.org/1999/xhtml":h6, "http://www.w3.org/1999/xhtml":ul, "http://www.w3.org/1999/xhtml":ol, "http://www.w3.org/1999/xhtml":dl, "http://www.w3.org/1999/xhtml":p, "http://www.w3.org/1999/xhtml":div, "http://www.w3.org/1999/xhtml":pre, "http://www.w3.org/1999/xhtml":blockquote, "http://www.w3.org/1999/xhtml":address, "http://www.w3.org/1999/xhtml":hr, "http://www.w3.org/1999/xhtml":table, "http://www.w3.org/1999/xhtml":form, "http://www.w3.org/1999/xhtml":fieldset, "http://www.w3.org/1999/xhtml":ins, "http://www.w3.org/1999/xhtml":del, "http://www.w3.org/1999/xhtml":script, "http://www.w3.org/1999/xhtml":noscript, "http://www.w3.org/1999/xhtml":extraData}' is expected.

What point am I missing?


Thanks for any support in advance!
Best Regards,
Thomas Urban
Received on Monday, 17 October 2011 09:04:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 17 October 2011 09:04:03 GMT