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

Re: comments and PIs in XML Schema

From: Michael Glavassevich <mrglavas@ca.ibm.com>
Date: Sat, 25 Apr 2009 13:34:58 -0400
To: "G. Ken Holman" <gkholman@CraneSoftwrights.com>
Cc: xmlschema-dev@w3.org
Message-ID: <OFD5B304D3.1C014238-ON852575A3.005F2F49-852575A3.006082C0@ca.ibm.com>
<gkholman@cranesoftwrights.com> wrote on 04/25/2009 01:04:13 AM:

<snip/>

> You won't see constraints on comments and PIs in DTD,

Not quite true. Elements declared to be EMPTY [1] in a DTD are forbidden
from containing comments, PIs and entity references (even ones whose
expansion is an empty string).

So a document such as:

<?xml version="1.0"?>
<!DOCTYPE root [
 <!ELEMENT root EMPTY>
]>
<root><?foo bar?></root>

isn't valid.

> 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.

<snip/>

> . . . . . . . . . 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

[1] http://www.w3.org/TR/2008/REC-xml-20081126/#elementvalid

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org
Received on Saturday, 25 April 2009 17:34:47 GMT

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