Michael, A couple other points about Schema... the current release is in synch with the 12/17 spec and is a subset. It only allows you to specify a schema file on the root element using the xmlns attribute. This is not the way the way it will stay. Also, use type and dataType, not complexType and simpleType. Refer to the personal-schema sample in the data directory of the release for more details.
The next release of schema support will be in synch with the 2/25 (or maybe even a bit later) spec. It will have complexType and simpleType. However, releases for a while (here at xml.apache) will be moving towards this target. So it may take a few weeks before it's all there. Features coming soon are inheritance of simple and complex types, forward references, schemaLocation, import and include and schemas across namespaces. Anys (wildcards) will be trailing a bit and unique and keys will be at the tail end. Also, the spec is still moving and not candidate release, so we will have to track these changes for the next couple to few months until it settles. Stay tuned! Tom Watson [EMAIL PROTECTED] [EMAIL PROTECTED] > -----Original Message----- > From: Michael Hucka [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 18, 2000 9:59 PM > To: Xerces Developer's Mailing List > Subject: How much of Schema parsing is really implemented in 1.0.3? > > > First, thank you to all the developers who have made Xerces possible and > available under open source. The following does not represent a > complaint, > just an attempt to get more information. > > I've been trying to learn how to use XML, XML Schemas and Xerces-J 1.0.3. > I read through the xerces-dev mailing list archives and saw George > T. Joseph's Mar 9 report: > > > Subject: Last change to XMLParser.java broke Schema validation > > From: George T. Joseph ([EMAIL PROTECTED]) > > Date: Thu Mar 09 2000 - 22:49:24 MET > > > Defaulting fNamespacesEnabled to 'true' in XMLParser causes > namespaces > > to be enabled for DOMParser as well as SAXParser. This causes Schema > > validation (which uses the DOMParser) to choke with > "Attribute "xmlns" > > must be declared for element..." plus a "must be declared" error for > > every element and attribute. Try the personal-schema.xml > with either > > "SAXCount -v" or "DOMCount". Plain DOMParser DTD validation also > > chokes. > > > To set the new SAX2 default, you might want to call > setNamespaces(true) > > in the SAXParser constructor rather than setting the field in > > XMLParser. > > and Jeffrey Rodriguez's reply: > > > Subject: Re: Last change to XMLParser.java broke Schema validation > > From: Jeffrey Rodriguez ([EMAIL PROTECTED]) > > Date: Fri Mar 10 2000 - 01:15:42 MET > > > Yes, that sounds like a screw up. The change was supposed > to be done in > > the SAXParser not the XMLParser. > > > It is a bug. > > I attempted to follow George Joseph's suggested fix, but I don't > think I got > it right (I'm still only learning Java). However, I do seem to > have gotten > Schema parsing to happen simply by setting > > parser.setFeature("http://xml.org/sax/features/validation", true); > > However, it appears that the Feb 2000 version of XML Schemas > somehow is not > parsed by Xerces. I'm encountering the following problems: > > 1) It appears that the <include schemaLocation="..."> facility is not > implemented; is this true? > > 2) Schema parsing fails on complexType if the complexType contains an > attribute definition like > > <complexType name="foo"> > <attribute name="a" type="integer"/> > <element name="bar" type="string"/> > </complexType> > > You get errors of this form: > > "The content of element type "complexType" must match > "(annotation?,((minInclusive|minExclusive|(maxInclusive|maxExclusi > ve)|precision|scale|pattern|enumeration|length|maxlength|minlength > |encoding|period)*|((element|all|choice|sequence|group|any)*,(attr > ibute|attributeGroup)*,anyAttribute?)))". > > I gather that XML Schemas are not entirely implemented yet, or at > least not > for the Feb 2000 spec. Is there a subset that will work? If so, what is > that subset? > > -- > Mike Hucka, Ph.D. -- [EMAIL PROTECTED] -- ph: 626.395.6818 > Postdoctoral researcher, software developer, systems administrator > GENESIS Development Group, Division of Biology 216-76, Caltech >
