W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2001

XML Schema context sensitive?

From: Holger Meuss <meuss@cis.uni-muenchen.de>
Date: Tue, 24 Apr 2001 17:24:12 +0200
To: www-xml-schema-comments@w3.org
Cc: meuss@loihi.cis.uni-muenchen.de
Message-Id: <01042417241201.12832@loihi>

I think the general opinion is that XML Schema can represent context free 
grammars, but no context sensitive grammars. 

I think that XML Schema **can** represent context sensitive grammars. 
 by means of local element declarations? Would you please correct if I'm 
wrong after considering the following example:


<?xml version="1.0" encoding="UTF-8"?>


<element name="A">
    <element name="C" type="string"/>
<element name="B">
    <element name="C" type="integer"/>



The following instance is valid:

<A xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
  <C> abc </C>


<B xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
  <C> abc </C>

is not valid. The reason for this is an explanation in Section 2.2.3 of the 

"If the two things are elements within different types (i.e. not global 
elements), say I declare one element called name as part of the USAddress 
type and a second element called name as part of the Item type, there is no 
conflict. (Such elements are sometimes called local element declarations.)"

Received on Tuesday, 24 April 2001 11:24:23 UTC

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