RE: XSV Crash on XHTML Schema

Eddie,
   The documentation element can have any element(s) from any namespace as
children, as well as any subtree below that, due to processContents='lax'
shown below.  You would not have to escape the children of <documentation>
in order to be valid.

See:
http://www.w3.org/TR/xmlschema-1/#element-documentation

..snipped from the schema 4 schema:
<element id='documentation' name='documentation'
xmlns:x='http://www.w3.org/XML/1998/namespace'>
   <complexType mixed='true'>
      <sequence maxOccurs='unbounded' minOccurs='0'>
         <any processContents='lax'/>
      </sequence>
      <attribute name='source' type='uriReference'/>
      <attribute ref='x:lang'/>
    </complexType>
</element>

-----Original Message-----
From: Eddie Robertsson [mailto:eddie@allette.com.au]
Sent: Wednesday, February 07, 2001 11:05 PM
To: Sean B. Palmer
Cc: Henry S. Thompson; xmlschema-dev@w3.org; Rick Jelliffe
Subject: Re: XSV Crash on XHTML Schema


"Sean B. Palmer" wrote:

> Hi,
> I just created an XML Schema for a simple subset of XHTML m12n [1], but
XSV
> throws up a very strange error [2]. It keeps saying that "html.content"
and
> "html.attlist" are undefined, when they clearly are, and it doesn't help
> even if I change the group names being referenced.
> Also, XSV doesn't seem to notice the <undefined/> element in the test
XHTML
> document [3], although that might be a consequence of it crashing out on
> me.

I had a look at the different schema documents involved and I found a couple
of
things that could cause your errors. The first thing I noticed (in xhtml.xsd
and some others) was that you have elements inside your <documentation>
element. I don't think you're allowed to have xml content within a
<documentation> element but you can solve it by using the escaped '<'. E.g.

<documentation>
   <div xmlns="http://www.w3.org/1999/xhtml">
   <h1>XHTML Simple 1.0 XML Schema</h1>
</documentation>

would become:

<documentation>
   &lt;div xmlns="http://www.w3.org/1999/xhtml">
   &lt;h1>XHTML Simple 1.0 XML Schema&lt;/h1>
</documentation>

I also noticed that you're using the "http://www.w3.org/1999/xhtml"
targetNamespace for all the schemas. Since you're using the
"http://www.w3.org/2000/10/XMLSchema" namespace as default namespace for all
schemas you need to qualify all your references to types and
elements/attributes you define with the "http://www.w3.org/1999/xhtml"
namespace. E.g. (in Common.xsd)

<attributeGroup name="Core">
   <attributeGroup ref="id"/>
   <attributeGroup ref="class"/>
   <attributeGroup ref="title"/>
</attributeGroup>

should be:

<attributeGroup name="Core">
   <attributeGroup ref="xhtml:id"/>
   <attributeGroup ref="xhtml:class"/>
   <attributeGroup ref="xhtml:title"/>
</attributeGroup>

where you have declared xhtml as xmlns:xhtml="http://www.w3.org/1999/xhtml"

In block.xsd you also have the following attributeGroup:

<attributeGroup name="pre.attlist">
   <attributeGroup ref="Common"/> (should be xhtml:Common)
   <attribute name="xml:space">
      <simpleType>
         <restriction base="xml:spaceX">
            <enumeration value="preserve"/>
         </restriction>
      </simpleType>
   </attribute>
</attributeGroup>

I'm not sure what you're trying to do but it seems you're trying to restrict
the values of the xml:space attribute and I don't think you're allowed to do
that.

> On another note (amatuer alert!), how you you denote the content model of
> an element (link, img etc.) as being empty? Simple question, I know... but
> I can't find the answer to it.

<xsd:element name="Empty">
   <xsd:complexType/>
</xsd:element>

Empty with an attribute:

<xsd:element name="Empty">
   <xsd:complexType>
       <xsd:attribute name="EmptyAttr" type="string"/>
   </xsd:complexType>
</xsd:element>

Hope this helps
/Eddie

> [1] http://infomesh.net/2001/xhtmls/xhtml.xsd
>  - XHTML Simple 1.0, Sean B. Palmer (based on Rick Jelliffe's
>    work (and some of my own earlier stuff)).
> [2]
>
http://www.w3.org/2000/09/webdata/xsv?docAddrs=http%3A%2F%2Finfomesh.net%2F
> 2001%2Fxhtmls%2Ftest.html&warnings=on&keepGoing=on&logOK=on&style=msxsl
> [3] http://infomesh.net/2001/xhtmls/test.html
>
> --
> Kindest Regards,
> Sean B. Palmer
> @prefix : <http://webns.net/roughterms/> .
> [ :name "Sean B. Palmer" ] :hasHomepage <http://infomesh.net/sbp/> .

Received on Thursday, 8 February 2001 00:09:49 UTC