[DDI-users] Re: new DDI dtds
Mark R. Diggory
ddi-users@icpsr.umich.edu
Wed, 28 Aug 2002 13:33:54 -0400
Some issues with Schema versions. I noticed there was an error in my
generation of the Schemas that has to do with "xml-lang". I had glanced
at this attribute and thought it was actually "xml:lang". Being that
xml:lang resides in the xml namespace, I had removed it expecting it to
be provided for default by most xml parsers. However, I was wrong about
this issue on two counts.
1.) xml-lang looks as though it was provided in the DDI as a
temporary solution to namespace issues in DTD's after Version1-01.
Generated schema attributes don't need to be removed.
Version1-02 and later use "xml-lang" and this can be
temporarily defined in the w3c schema as:
<xs:attribute name="xml-lang" type="xs:NMTOKEN"/>
2.) Versions 1, 1-01, use the xml:lang attribute. The xml
namespace needs to be explicitly imported in the w3c Schema to be
present in and valid in xml doc's validated against that schema.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" >
<xs:import
namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
References (instead of named attributes) to the xml:lang
attribute are now valid in the Version.xsd
<xs:attribute ref="xml:lang" type="xs:NMTOKEN"/>
So I've made these changes to my Schema Versions of the DDI on our
website. I've also included xsd versions of the experimental DTD's you
provided with the same adjustments:
http://osprey.hmdc.harvard.edu:8180/VDC/ddi
-Mark
p.s.
Just to note, I am using XMLSpy IDE version 4.3 to first generate these
Schema's. The following configuration is what I'm using so it shouldn't
be difficult to repeat by interested parties.
1.) Validation is done using XMLSpy's internal Parser (I'd like to begin
testing these against Microsoft and Apache XML Parsers).
2.) Off of the DTD/Schema menu I'm selecting Convert DTD/Schema and
setting the following Attributes.
DTD/Schema file format --> W3C Schema
Represent complex elements as --> Complex Types
Elements which were used once --> Make Global definition
For versions 1 and 1-01 I had to make adjustments to the converted
schema to import the xml namespace.
For all other versions the xml-lang attribute is adiquate for validation
(I however recomend future w3c schema versions should probibly approach
using the "xml:" namespace. In fact a whole array "xml:" attributes can
be provided for simply by using the following approach.
<xs:complexType name="XXX" mixed="true">
...
<xs:anyAttribute
namespace="http://www.w3.org/XML/1998/namespace" processContents="lax" />
</xs:complexType>
this would provide for following xml: attributes
xml:lang
xml:space
xml:base
all of which are useful for various tasks during validation, parsing,
resolving relative file locations, etc.
Sanda Ionescu wrote:
> Hi, Mark!
> Following yesterday's communications with Mary Vardigan, here are our
> two new versions of the DDI DTD.
> Version 1.2.2 is the "stable" one and 1.3 the "development" one.
> Thanks for your help.
>
> Sanda.
>
> Sanda Ionescu
> Research Associate
> Inter-university Consortium for Political and Social Research (ICPSR)
> 311 Maynard St.
> Ann Arbor, MI 48104-2211
> Phone: (734) 998-9895
> Fax (734) 998-9889