OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] XML Schema considered harmful?

[ Lists Home | Date Index | Thread Index ]

Murali Mani scripsit:

> I am very glad that RELAX NG recently came up with a non XML syntax also..
> I have not checked it out, but I am confident it will be useful.. I am
> sure that XML syntax might be useful in several scenarios (though I do not
> know when, and I do not think i need them at this point of time).

Basically the XML syntax is useful for processing, whereas the RNC (compact)
syntax is useful for authoring.  Validating can be done with either syntax,
if you use the Jing validator.  Here is a Real World schema in RNC syntax,
namely my IBTWSH6 schema, which is a subset of HTML Basic.

There are certain improvements over the DTD version: for example, only
one of the "rel" or "rev" attributes is allowed in an "a" element, and only one
of the "name" or "http-equiv" attributes is allowed in a "meta" element.
Further, the "title" element can be allowed anywhere in a "head" element,
not just at the beginning.

=====cut here=====

# Common attributes

# All elements (except full-document elements) can have these attributes

all =		attribute id {xsd:ID}?,
		attribute class {token}?,
		attribute title {text}?

# All non-empty elements can have these attributes

i18n =		attribute xml:lang {text}?,
		attribute dir {"ltr" | "rtl"}?

basic =		all, i18n


# Models

horiz.model =	basic & text & horiz*
vert.model =	horiz.model & vert*
struct.model = 	basic & vert*


# Horizontal formatting elements

horiz =		a | br | horiz.other

a =		element a {
			attribute href {xsd:anyURI}?,
			attribute name {text}?,
			attribute rel | rev {xsd:anyURI}?,
			horiz.model
			}

br =		element br {all, empty}

horiz.other =	element abbr | acronym | cite | code |
			dfn | em | img | kbd | q | samp | span |
			strong | var {horiz.model}


# Vertical formatting elements

vert	=	header | List | table | vert.other

header = 	element h1 | h2 | h3 {horiz.model}


List =		element dl {basic, element dt | dd {horiz.model}+ } |
		element ol|ul {basic, element li {horiz.model}+ }

aligns = 	attribute align {"left" | "center" | "right" | "justified"}?,
		attribute valign {"top" | "middle" | "bottom" | "baseline"}?

table = 	element table {
			basic,
			attribute summary {text}?,
			element caption {horiz.model}?,
			element tr {
				basic,
				aligns,
				tabledata+}+
			}

tabledata =	element th | td {
			aligns,
			attribute abbr {text}?,
			attribute axis {text}?,
			attribute colspan {xsd:nonNegativeInteger}?,
			attribute headers {xsd:IDREFS}?,
			attribute rowspan {xsd:nonNegativeInteger}?,
			attribute scope {"row" | "col" | "rowgroup" | "colgroup"}?,
			vert.model
			}

vert.other =	element address {horiz.model} |
		element blockquote {attribute cite {xsd:anyURI}?, struct.model} |
		element div {struct.model} |
		element p {horiz.model} |
		element pre {horiz.model}


# Support for complete HTML documents

start = 	element html {
			i18n,
			attribute xml:base {xsd:anyURI}?,
			attribute xml:space {"preserve" | "default"}?,
			head,
			element body {basic, vert*}
			}

head =		element head {
			i18n &
			element title {i18n, text} &
			element meta {
				attribute name|http-equiv {token}?,
				attribute content {text},
				empty
				}*
			}

=====cut here=====

-- 
John Cowan <jcowan@reutershealth.com>     http://www.reutershealth.com
I amar prestar aen, han mathon ne nen,    http://www.ccil.org/~cowan
han mathon ne chae, a han noston ne 'wilith.  --Galadriel, _LOTR:FOTR_




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS