W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2009

Re: comments and PIs in XML Schema

From: Mukul Gandhi <gandhi.mukul@gmail.com>
Date: Sat, 25 Apr 2009 10:53:42 +0530
Message-ID: <7870f82e0904242223p52dcdc78s5d3885beaae73c57@mail.gmail.com>
To: "G. Ken Holman" <gkholman@cranesoftwrights.com>
Cc: xmlschema-dev@w3.org
Thanks, Ken for the reply. This answers my question.

On Sat, Apr 25, 2009 at 10:34 AM, G. Ken Holman
<gkholman@cranesoftwrights.com> wrote:
> At 2009-04-25 08:10 +0530, Mukul Gandhi wrote:
>>
>>  I couldn't see provisions in the XML Schema languages (both 1.0 and
>> 1.1) to have XML "comments" and "processing instructions" as part of
>> the validation requirements.
>>
>> Why are "comments" and PIs not considered XML Schema validation
>> primitives?
>
> I call these two constructs "XML annotations" though that is not an official
> term for them, only a convenient pigeon hole or label for them.
>
> Schema languages constrain XML vocabularies and their content.  Comments and
> processing instructions are not part of an XML vocabulary, only elements and
> attributes and their content.
>
> Annotations can be placed anywhere they are allowed in an XML document
> without violating the constraints on an XML vocabulary.
>
> You won't see constraints on comments and PIs in DTD, W3C Schema, RELAX-NG
> or NVDL semantics.  I doubt any of the prototypical or bespoke XML
> vocabulary validation languages would constrain these either.  I suppose
> someone could dream up some validation semantics to constrain them, and
> implement them with something like Schematron.  But that would be more like
> a "document writing constraint" rather than an XML vocabulary constraint.
>
>> Please pardon me, if I am missing something.
>
> http://www.w3.org/TR/xml/#syntax
>  - Text consists of intermingled character data and markup
>
> http://www.w3.org/TR/xml/#sec-comments
>  - They are not part of the document's character data; an XML
>    processor MAY, but need not, make it possible for an application
>    to retrieve the text of comments
>
> http://www.w3.org/TR/xml/#sec-pi
>  - PIs are not part of the document's character data, but MUST
>    be passed through to the application.
>
> I hope this helps.
>
> . . . . . . . . . Ken
>
> --
> XQuery/XSLT/XSL-FO hands-on training - Los Angeles, USA 2009-06-08
> Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
> Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
> Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
> G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
> Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
> Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/x/bc
> Legal business disclaimers:  http://www.CraneSoftwrights.com/legal



-- 
Regards,
Mukul Gandhi
Received on Saturday, 25 April 2009 05:24:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:11 GMT