W3C home > Mailing lists > Public > public-xmlsec@w3.org > January 2010

Re: RNG schema plans

From: MURATA Makoto (FAMILY Given) <eb2m-mrt@asahi-net.or.jp>
Date: Thu, 21 Jan 2010 10:15:36 +0900
To: "'XMLSec WG Public List'" <public-xmlsec@w3.org>
Cc: Murata <eb2m-mrt@asahi-net.or.jp>
Message-Id: <20100121101535.801A.B794FC04@asahi-net.or.jp>

> > But you do not have to enumerate what has to be skipped; you can
> > rely on wild cards such as
> > 
> > anyForeignElement = element * - ds:* {
> >   mixed { anyAttribute*, anyForeignElement* } }
> 
> I suppose that suggests you're better off with that approach.

What I'm doing is the mixture of two: validation and skipping.
When the algorithm is specified a part of the spec and permissible
children are known, a pair of a value of @Algorithm and 
a content model  is provided.  When the algorithm is not known,
any pair of @Algorithm and children is allowed.  These two kinds 
of pairs are COMBINED. 

For exmaple, xmldsig-core-schema.rnc has

ds_CanonicalizationMethodType =
  attribute Algorithm { 
    xsd:anyURI "http://www.w3.org/TR/2001/REC-xml-c14n-20010315" }
  | attribute Algorithm { 
    xsd:anyURI "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" }
  | attribute Algorithm { 
    xsd:anyURI "http://www.w3.org/2006/12/xml-c14n11" }
  | attribute Algorithm { 
    xsd:anyURI "http://www.w3.org/2006/12/xml-c14n11#WithComments" }

while allowAnyForeign.rnc has

ds_CanonicalizationMethodType |= 
  attribute Algorithm { xsd:anyURI },
  anyForeignElement*

They are combined.  "|=" means combination by union.

Note that elements of the ds namespace are not allowed, when the 
value of the Algorithm attribute is not one of the four specific ones 
shown in the first definition.

My work would have been easier if I had relied on the latter definition 
only.  But that approach would make validation loose and RELAX NG 
schemas less informative and useful.

I would like to be as specific as possible in the first type of
definitions.  That's why I'm asking.

Cheers,
Makoto
Received on Thursday, 21 January 2010 01:16:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 21 January 2010 01:16:13 GMT