Re: Validating data-* attributes in XHTML5?
In XSD 1.0 you can allow these attributes (and many others of course) by use of an <xs:anyAttribute> wildcard. In XSD 1.1 you can then constrain the attribute names that match the wildcard using assertions. It has always been the case, of course, that not all rules in the XHTML specification are capable of being expressed in XSD. The same applies to most other vocabularies (including XSD itself). Michael Kay Saxonica On 05/05/2012 14:59, Graham Hannington wrote: > Preamble (if you prefer, skip to the "Question(s)" heading): > > I am lagging (years) behind in my knowledge of HTML5 - I have been fixated > on XHTML 1.0 Strict compliance - but I am trying to catch up. > > Someone (thank you, Chris!) recently pointed out to me that HTML5 allows > attributes named data-* (for example, data-atlassian-layout). > > I had observed the use of data-* attributes by various applications, but > the news of the inclusion of these attributes in the HTML5 spec frankly > blindsided me (I did say I was far behind). > > As mentioned in a recent thread on this mailing list, I have developed a > DTD and XSDs (W3C XML Schema 1.0) for an XML vocabulary that consists of a > combination of: > - Proprietary elements and their attributes, and > - Elements that have the same name as elements in XHTML (so far, > exclusively from XHTML 1.0; and - until now, hence this email - with > attributes that are a subset of the attributes allowed in XHTML 1.0 > Strict). > > This XML vocabulary is evolving. The developers have begun using a > data-atlassian-layout attribute on div elements. > > I have added corresponding explicit definitions for this new attribute to > the DTD and XSD (for that particular target namespace). But it's raised > some questions in my mind. > > Question(s): > > It occurs to me that HTML5 allowing data-* attributes means that any given > XHTML5 document instance cannot be validated using a fixed, standard XML > DTD or W3C XML Schema 1.0 (or 1.1, for that matter) document (XSD). > Because (to my knowledge), DTDs and XSDs require you to explicitly specify > attribute names; you cannot, in these particular schema languages, define > attributes with wildcarded names. If an XHTML5 document instance contains > data-* attributes, then, if you want to use a DTD or an XSD to validate > it, the DTD or XSD must explicitly define those particular data-* > attribute names (data-this, data-that; not just data-*). Correct? > > Effectively the same point/question, stated slightly differently... With > XHTML 1.0, one could use a standard DTD/XSD from W3C, unmodified, to > validate all XHTML 1.0 document instances. It seems to me that you will > not be able to use a single, standard DTD/XSD from W3C to validate all > XHTML5 document instances. You'll need to define any data-* attributes. > Correct? > > I imagine that the reaction of many readers will be (a more erudite > version of) "Well, d'uh! Have you been living under a rock?" I've Googled, > but have so far not found any rock-solid ;-) answers to this specific > issue. > > Are there any other aspects of XHTML5 that introduce new* problems for > validating with DTD/XSDs? > > * Specifically, compared to validating XHTML 1.0 with DTD/XSDs? (I do not > seek an answer that covers *all* of the shortcomings of these two schema > languages - such as the inability to describe various kinds of constraints > - although I understand that some of these shortcomings are likely to be > closely tied to the problems with validating XHTML5 versus validating > XHTML 1.0.) > > I am aware of http://html5.validator.nu/ and its associated > http://about.validator.nu/, and I am learning (for example, about Relax > NG). > > Graham Hannington > Perth, Western Australia > > Fundi Software Pty Ltd 2012 ABN 89 009 120 290 > > > This message has been scanned for malware by Websense. www.websense.com > > _______________________________________________________________________ > > XML-DEV is a publicly archived, unmoderated list hosted by OASIS > to support XML implementation and development. To minimize > spam in the archives, you must subscribe before posting. > > [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/ > Or unsubscribe: email@example.com > subscribe: firstname.lastname@example.org > List archive: http://lists.xml.org/archives/xml-dev/ > List Guidelines: http://www.oasis-open.org/maillists/guidelines.php > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format