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

IBTWSH in RNG (was: Goodbye to textual applications?)

non empty xsd elements
Sean McGrath wrote:

 > I use DTDs for their most excellent powerful, intuitive, concise,
 > extended regular expression notation. [...]
 > DTDs are not perfect, there are multiple alternatives, some better
 > than others for document-oriented XML applications.

RELAX NG serves these purposes very well, and could well have been
called "DTD NG".  Using the unofficial non-XML syntax, I think
it deserves all of your adjectives quite as much as DTDs.

Just for the fun of it, here is one of my own DTDs converted to
RNG unofficial syntax.  I have removed the introductory comments;
the DTD version is at http://www.ccil.org/~cowan/XML/ibtwsh6.dtd
I have added some datatypes based on the HTML 4.0 documentation.
SGML weenies should note particularly the definitions of "simple"
and "head".

IBTWSH is intended to be used to add rich documentation to elements
of basically data-oriented XML applications.

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

#   ibtwsh.rngnx
#   This is the Itsy Bitsy Teeny Weeny Simple Hypertext RELAX NG Schema.

default namespace = "http://www.w3.org/1999/xhtml"
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
start = html		# Override this when including


# All elements (except full-document elements) have these attributes
all =     attribute id {xsd:ID}?,
           attribute class {text}?,
           attribute title {text}?

# All non-empty elements have these attributes
i18n =    attribute xml:lang {text}?,
           attribute dir {"ltr"|"rtl"}?

# Most elements have both sets of attributes
basic =   all, i18n


horiz =   mixed {simple | a | br}
vert =    address | blockquote | \div | dl | headings |
           list | p | pre | table

horiz.model = horiz*
vert.model = (horiz | vert)*
struct.model = vert*


simple =  element
                {basic, horiz.model}
a =       element a {
           attribute href {xsd:anyURI}?,
           attribute name {text}?,
           (attribute rel {text} | attribute rev {text})?,
br =      element br {all}


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


aligns =  attribute align {"left"|"center"|"right"|"justify"}?,
           attribute valign {"top"|"middle"|"bottom"|"baseline"}?
tblinfo = attribute abbr {text}?,
           attribute axis {text}?,
           attribute colspan {xsd:integer}?,
           attribute headers {xsd:IDREFS}?,
           attribute rowspan {xsd:integer}?,
           attribute scope {"row"|"col"|"rowgroup"|"colgroup"}

table =   element table {
           attribute border {xsd:integer}?,
           attribute cellpadding {text}?,
           attribute cellspacing {text}?,
           attribute summary {text}?,
           attribute width {text}?,
           caption?, tr+}
caption = element caption {basic, horiz.model}
tr =      element tr {basic, aligns, (th | td)+}
th =      element th {basic, aligns, tblinfo, vert.model}
td =      element td {basic, aligns, tblinfo, vert.model}


address = element address {basic, horiz.model}
blockquote = element blockquote {
           attribute cite {xsd:anyURI},
\div =    element div {basic, struct.model}
h =       element h1|h2|h3 {basic, horiz.model}
p =       element p {basic, horiz.model}
pre =     element pre {basic, horiz.model}


html =    element html {
           attribute xml:base {xsd:anyURI}?,
           attribute xml:space {"default"|"preserve"}}?
head =    element head {i18n, (title & base?)}
title =   element title {i18n, text}
base =    element base {attribute href {xsd:anyURI}}
body =    element body {all, struct.model}

Not to perambulate             || John Cowan <jcowan@r...>
     the corridors               || http://www.reutershealth.com
during the hours of repose     || http://www.ccil.org/~cowan
     in the boots of ascension.  \\ Sign in Austrian ski-resort hotel


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.
First Name
Last Name
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.