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 Wednesday, 7 February 2001 23:01:23 UTC