W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2011

[Bug 13935] xsd 1.1 assertions testing comment nodes

From: <bugzilla@jessica.w3.org>
Date: Tue, 01 Nov 2011 04:06:30 +0000
To: www-xml-schema-comments@w3.org
Message-Id: <E1RL5cM-0000XO-9X@jessica.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=13935

--- Comment #10 from Mukul Gandhi <gandhi.mukul@gmail.com> 2011-11-01 04:06:27 UTC ---
(In reply to comment #6)
> The WG notes that making something implementation defined requires strong
> justification for so doing, and the WG would really rather not go there at this
> time.

I've few new thoughts about this below,

I'm in favor of both view points in this regard (infact I see pros and cons of
both these options). i.e allowing comments and PIs to be visible to assertions,
and also if the comments and PIs are not visible to assertions.

According to me, the advantage of allowing comments and PIs to be visible to
assertions is providing the only facility in XSD 1.1 language to allows XSD
schema authors to use comments and PIs for XML validation purposes.

The cons of allowing comments and PIs for validation purposes may have
following disadvantages,
- in typical real world XML documents, comments are provided in XML documents
in large quantity. If we allow comments to affect XML instance validity, then 
it could make the XSD validator inefficient (all comments will be pushed to the
validator layer, and the validator has to consider them. consider some of huge
comments like HTML fragments and so on -- the cost of processing these by the
validator may be high).
- The current overall philosophy of XSD is to ignore comments and PIs for all
validation purposes. If we now allow comments and PIs to be visible to
assertions, then they may validate or invalidate an element or attribute, and
this would conflict with the current high level approach taken by XSD language
in this regard (i.e comments and PIs would not affect validity of XML
documents). I believe, if we allow comments and PIs for assertions, then this
must be consistent with the overall current XSD philosophy (perhaps a modified
view of the WG, that comments and PIs may affect the validity of XML documents,
and the WG in future versions of the spec may allow comments and PIs as first
class constructs for validation purposes).

I can imagine another solution to be able to consider comments and PIs for
validation purposes. i.e use comments and PIs in a non XSD layer for validation 
purposes. i.e one could write a custom validation pipeline that allows "non XSD
& comments/PI" aware processing which then moves to the XSD layer (or perhaps
in another direction). The combined result of evaluating this validation
pipeline may be the effective validation outcome for the application.

Since Saxon allows using comments and PIs for assertion processing (I don't
suggest to prohibit implementations to use comments and PIs for validation 
purposes), but some of other implementations currently don't, I see a possible
case of allowing using this feature as implementation defined. As I wrote 
earlier above, the performance costs of using comments (majorly) and PIs should
allow implementations to not provide this functionality, or provide it via an 
option.

But I would be happy with the decision that WG would take about this point.


Thanks.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Tuesday, 1 November 2011 04:06:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 1 November 2011 04:06:40 GMT