OOXML XML Schemas reference xml:space as an attribute value, but don’t provide a schemaLocation for the schema for the XML namespace. Although this is legal XML Schema (the schemaLocation is a hint, rather than required), it imposes an unnecessary complication on using the schema (since the schema location must be specified separately, either automatically by the validator as MSXML does, or using a catalog as most other tools do).

Remedy: Alter the stylesheets (wml.xsd, shared-math.xsd) which import the xml namespace to include a schemaLocation of http://www.w3.org/2001/xml.xsd. Affects files: wml.xsd, shared-math.xsd

No schemaLocation for XML namespace

te

Proposed Disposition of DIS 29500 Comment GB-0622 (Modified: 2008-01-10) Agreed; although on further investigation, it appears that different validators handle this in different ways. Xalan, and Saxonica require that the xml namespace to be imported into the schemas, and that the schemaLocation attribute be specified. Xerces also requires that the xml namespace be imported, but the location must be a local path. MSXML does not require that the xml namespace be imported. However, if you do import the xml namespace, MSXML6 requires that there NOT be a schemaLocation attribute. System.Xml validates properly if the schema imports the xml namespace with a schemaLocation. It also validates properly if the schema does not import the xml namespace. As it’s not clear what the most interoperable approach is for this functionality, rather than change the schemas, we will instead provide the following comment at the beginning of each XSD file that uses the XML namespace, so that people can customize it to best work with their validator: <xsd:import id="xml" namespace="http://www.w3.org/XML/1998/namespace"/> <!– Note, the preceding import statement may need to be modified depending on the W3C XML Schema validator you are using. If your validator requires the schemaLocation be present, you may use the following import statement: <xsd:import id="xml" namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" /> If you’re validator requires that the schema be stored locally, you should first download the schema from the following URL http://www.w3.org/2001/xml.xsd, and then update the schemaLocation attribute to point to the local path of the schema file: <xsd:import id="xml" namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="[local path] "/> –> Similar Comments: ECMA-0012 ,

Tag and Go

1 Comment

  1. Steve Loughran December 3, 2007 @ 11:34 pm

    This is mandated by the comments in xml.xsd itself:

    This schema defines attributes and an attribute group
    suitable for use by
    schemas wishing to allow xml:base, xml:lang or xml:space attributes
    on elements they define.

    To enable this, such a schema must import this schema
    for the XML namespace, e.g. as follows:
    <schema . . .>
    . . .
    <import namespace=”http://www.w3.org/XML/1998/namespace”
    schemaLocation=”http://www.w3.org/2001/03/xml.xsd”/>

    Subsequently, qualified reference to any of the attributes
    or the group defined below will have the desired effect, e.g.

    <type . . .>
    . . .
    <attributeGroup ref=”xml:specialAttrs”/>

    —-

    This could be a parser compatibility issue again; xml: is sometimes handled specially by parsers as it is a well known prefix (like xmlns)

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

  • Argentina (1)
  • Australia (30)
  • Austria (1)
  • Belgium (1)
  • Brazil (64)
  • Bulgaria (3)
  • Canada (79)
  • Chile (217)
  • China (1)
  • Colombia (237)
  • Czech Republic (75)
  • Denmark (168)
  • Ecma (76)
  • Ecuador (1)
  • Finland (15)
  • France (592)
  • Germany (162)
  • Ghana (12)
  • Greece (113)
  • India (82)
  • Iran (58)
  • Ireland (12)
  • Israel (33)
  • Italy (2)
  • Japan (82)
  • Jordan (1)
  • Kenya (81)
  • Malaysia (23)
  • Malta (5)
  • Mexico (7)
  • New Zealand (54)
  • Norway (12)
  • Peru (10)
  • Philippines (7)
  • Poland (4)
  • Portugal (118)
  • Singapore (2)
  • South Africa (17)
  • South Korea (25)
  • Spain (1)
  • Switzerland (19)
  • Thailand (1)
  • Tunisia (3)
  • Turkey (1)
  • UK (635)
  • Uruguay (18)
  • USA (288)
  • Venezuela (73)