Subject: RE: [Simple] Strength of XML validity requirements in SIMPLE documents

From: [email-masked]
Date: Wed, 22 Sep 2004 11:54:06 +0300

How does this proposal sound (for the filter drafts):

In the format document, the following text appears: The XML document MUST be well-formed and MUST be valid according to schemas, including extensions schemas, available to the validater and applicable to the XML document.

In the functionality draft: The creator MUST ensure that the XML document is well-formed and valid. The creator MUST NOT insert any extension elements or attributes into the XML document unless it has access to the extension schema and can validate the XML document. The XML document consumer MUST validate the XML document according the schemas, including extension schemas, it has access to that are applicable to this XML document.

For pidf, the second part might be slightly different since the creator of the document can be the compositor and the compositor can create a presence XML document by aggregating tuples that contain extensions that the compositor is unaware of. Perhaps something can go in the Date Model draft discussing this.

Regards,
Hisham

> -----Original Message-----
> From: [email-masked] 
> [mailto:[email-masked]]On Behalf
> Of ext Pekka Pessi
> Sent: 20.September.2004 14:36
> To: Jonathan Rosenberg
> Cc: Pessi Pekka (Nokia-NRC/Helsinki); Urpalainen Jari
> (Nokia-NRC/Helsinki); [email-masked]; Robert Sparks
> Subject: Re: [Simple] Strength of XML validity requirements in SIMPLE
> documents
> 
> 
> Jonathan Rosenberg <[email-masked]> writes:
> >I'm saying that a document of type application/pidf+xml 
> could be valid
> >against the PIDF schema, but it contains extensions (which 
> are allowed in
> >the pidf schema), and those extensions make use of elements 
> defined in
> >another schema. However, those elements are not valid 
> according to that
> >other schema.
> 
> >In this case, do we consider this document "valid"?
> 
> Term valid has at least three different senses with the XML:
> 
> 1) 
> 
> W3C defines that an XML document is valid when it has a DTD and
> the document complies with the constraints set forth in DTD.
> 
> That is not what we want. No <!DOCTYPE> for presence, no "MUST be
> valid", please.
> 
> (When RFC 3863 says that the application/pidf+xml document MUST
> be well-formed and SHOULD be valid, I guess it just says that
> extensions are allowed, even if they are not shown in the DTD.)
> 
> 2) 
> 
> XML schema specification uses a bit different terminology. Schemas
> don't specify documents, but trees (item and all its descendants). 
> You can assess validity of a particular tree, for instance, all
> the XML stuff within <presence> element. The validator can also
> skip certain elements (like the wildcard elements used for
> extending pidf). So, validator can return different results: tree
> and items within it are fully validated, partially validated, or
> not validated at all. Also each, item within the tree are valid or
> invalid or their validity is not known.  
> 
> I'd say that the XML document is schema-valid if its root element
> is fully validated and it and all its descendants are valid. This
> is not the official definition, however.
> 
> This is unfeasible for the intermediate nodes (or processes), too. 
> Unless the node knows the schema (and semantics) of all the
> extensions, it cannot assess the validity of composed or filtered
> documents. I think filtering and composing is precisely the things
> that we want to do in the server nodes.
> 
> I can also imagine some applications that would just use existing
> presence service, just add their non-standard application-specific
> status in the published presence document. Now imagine two of
> those applications running on the same node.
> 
> 3)
> 
> Beside validity assessment, XML schema specification has the
> concept of "local schema-validity", too:
> 
> <http://www.w3.org/TR/xmlschema-1/#section-Overview-of-XML-Schema>
> 
> I must admit that I don't fully understand what this
> means, but I have a good hunch that it is what most of us
> want. ;)
> 
> A element or attribute is valid if it satisfies the constraints
> set by the XML schema. So, <presence> element is valid, if it
> contains entity attribute, zero or more <tuple> elements, then
> zero or more <note> elements and after then something wildcarded
> stuff (I guess that is anything else but pidf-namespace stuff). I
> don't understand how the datatype checking of evil types like
> xs:ID or xs:IDREF is done when the "local schema-validity" is
> determined. I *guess* that ID/IDREF attribute in tuple is valid if
> its value is syntactically correct. Like id="_123" is valid but,
> id="123" is not. No check for all id's within a document/item and
> all of its descendats is required.
> 
> So, if we have a application/pidf+xml document, we can simply say
> that it MUST conform to its schema and other requirements set
> forth in RFC 3863. If we want to be more verbose, we could say
> that the root node in the document MUST be partially or fully
> validated and none of the validated nodes MUST NOT be invalid. Or
> we could invent our own term and say that documents MUST be
> locally-schema-valid with the schema XXX.
> 
> --Pekka
> 
> _______________________________________________
> Simple mailing list
> [email-masked]
> https://www1.ietf.org/mailman/listinfo/simple
> 

_______________________________________________
Simple mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/simple

---

From: "Pete Cordell" <[email-masked]>
Date: Thu, 23 Sep 2004 13:55:32 +0100

Hi Hisham,

For my money, your statements are roughly right.  The only concern I have is
the bit where it says: "...consumer MUST validate...".  It's probably not
the intent, but there's a potential implication that the IETF is saying that
consumers must run a separate validation exercise on the received data
(rather than say implicitly validating while the application interprets the
data, in which case they may only end up validating the parts of the data
they are interested in).  It sounds like the IETF is saying how people
should build their devices which traditionally they haven't done.  It's
probably not a big issue, but a possible re-wording is:-

"The XML document received by a consumer MUST be valid according the
schemas, including extension schemas, the consumer has access to that are
applicable to this XML document.  The consumer MAY validate the received XML
document against such schemas, and MAY reject the XML document if such
validation is not successful."

I'll leave it to you.

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware
pete(at)tech-know-ware.com
http://www.tech-know-ware.com
http://www.xml2cpp.com - Now Available
+44 1473 635863
=============================================

----- Original Message ----- 
From: <[email-masked]>
To: <[email-masked]>; <[email-masked]>
Cc: <[email-masked]>; <[email-masked]>; <[email-masked]>;
<[email-masked]>
Sent: Wednesday, September 22, 2004 9:54 AM
Subject: RE: [Simple] Strength of XML validity requirements in SIMPLE
documents

In the format document, the following text appears: The XML document MUST be
well-formed and MUST be valid according to schemas, including extensions
schemas, available to the validater and applicable to the XML document.

In the functionality draft: The creator MUST ensure that the XML document is
well-formed and valid. The creator MUST NOT insert any extension elements or
attributes into the XML document unless it has access to the extension
schema and can validate the XML document. The XML document consumer MUST
validate the XML document according the schemas, including extension
schemas, it has access to that are applicable to this XML document.

For pidf, the second part might be slightly different since the creator of
the document can be the compositor and the compositor can create a presence
XML document by aggregating tuples that contain extensions that the
compositor is unaware of. Perhaps something can go in the Date Model draft
discussing this.

Regards,
Hisham