W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2009

Re: Conditional Levels of a Schema

From: XML4Pharma <info@XML4Pharma.com>
Date: Tue, 7 Apr 2009 16:37:15 +0200
Message-ID: <97E3F6C33C164603A03DBF0E58024DDF@D6NXTQ1J>
To: "Dieter Menne" <dieter.menne@menne-biomed.de>, <xmlschema-dev@w3.org>
Technically this sounds nice ...

but, if I do understand it well, this means that you have two different 
(versions of the) schemas, with the same namespace, and different (although 
slightly different) content.

This is something, just from a principal point of view, I do not like.
My principle is "new standard (version) => new schema (version) => new 
I have seen standards, where each subsequent version used the same 
namespace, though the schemas were different.
I have even seen different standards (root element is different), with 
different schemas, all having the same namespace.

When allowing different schemas (i.e. different rules) having the same 
namespace, you know where you start, but you do not know where you end 
(probably in disaster).
For example, how do you work when you need to write an extension of one 
schema with elements/attributes of the other, when both have the same 

In your case, I would definitely opt for writing a schematron (which is a 
good excercise anyway).  ;-)

With best regards,


Jozef Aerts


----- Original Message ----- 
From: "Dieter Menne" <dieter.menne@menne-biomed.de>
To: <xmlschema-dev@w3.org>
Sent: Tuesday, April 07, 2009 3:41 PM
Subject: RE: Conditional Levels of a Schema

> In case someone is going to need it, here is Pete's suggestion:
> The Master Schema
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="0.3"
>   xmlns:hrm="http://www.hrmconsensus.org/layers">
> <xs:element name="xhrm">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="device" type="xs:string"/>
> <xs:element minOccurs="0" maxOccurs="1" name="patient"
>    type="xs:string" hrm:patientInfo="1"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> Use xsl to convert it to a another xsd where patient info is required. I
> tried to use result-document with it, but could not get the syntax 
> correct.
> <?xml version="1.0"?>
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:hrm="http://www.hrmconsensus.org/layers">
>  <xsl:output method="xml" indent="no"/>
>  <xsl:template match="node()|@*">
>    <xsl:copy>
>      <xsl:apply-templates select="@*"/>
>      <xsl:apply-templates/>
>    </xsl:copy>
>  </xsl:template>
>  <xsl:template match="@hrm:patientInfo">
>    <xsl:attribute name="minOccurs">
>      <xsl:value-of select="1"/>
>    </xsl:attribute>
>  </xsl:template>
> </xsl:stylesheet>
> -- 
> View this message in context: 
> http://www.nabble.com/Conditional-Levels-of-a-Schema-tp22905179p22929208.html
> Sent from the w3.org - xmlschema-dev mailing list archive at Nabble.com.
Received on Tuesday, 7 April 2009 14:38:01 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:16 UTC