Re: [RAI] [Geopriv] PLEASE TAKE NOTE: Fwd: [TechnicalErrata Reported] RFC4480 (3121)

"Pete Cordell" <[email protected]> Mon, 20 Feb 2012 10:36:03 -0000
Newsgroups gmane.ietf.simple,gmane.ietf.geopriv
Message-ID <4FE9598F0B7E440FBC143D124F4437A6@codalogic>
Original Message From: "Saúl Ibarra Corretgé"
> On Feb 16, 2012, at 7:26 PM, Hannes Tschofenig wrote:
>>
>> I am curious: Why you do schema validation?
>>
>> When you receive a PIDF document in a SIP message then you will have to
>> parse it. Since we put any namespace="##other" statements in nearly all
>> our schema files I am curious what you actually going to learn from the
>> validation since almost everything validates without error.

> Well, I like to do schema validation to al least know that the document
> doesn't violate the specified structure. Yes, you may put whatever you
> want
> in ##other, but PIDF does define certain elements, and those will not fall
> in the ##other bucket, so those should be validated.

I don't know anything about PIDF, but I know a bit about XML Schema and I
think there might be some mis-understanding of what <xs:any
namespace="##other"> does.

If you have a schema fragment like:

     <xs:element name="activities">
       <xs:complexType>
               <xs:choice>
                 <xs:element name="breakfast"
                   type="empty" />
                 <xs:element name="dinner"
                   type="empty" />
                 <xs:element name="meal"
                   type="empty" />
                 <xs:any namespace="##other"
                   maxOccurs="unbounded" processContents="lax"/>
               </xs:choice>
       </xs:complexType>
     </xs:element>

Then the following would _violate_ the schema:

<activities><lunch/></activities>

The reason is that the <xs:any> element is specifying that the extension
must be in an-other namespace, not the namespace specified by the schema.

Something like the following would be OK:

<activities>
    <xmlns:v2="urn:ietf:params:xml:ns:pidf:rpid:v2" v2:lunch/>
</activities>

So as I understand it, I believe this change could
break existing implementations that choose to use schema
validation.  Whether, given the state of current implementation, that is a 
issue in practice is a matter for the group.

HTH,

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info