[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML Schema considered harmful?


xml schema meta element
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@r...>     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_

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.