Initial commit

This commit is contained in:
John Doty 2012-03-22 07:16:09 -07:00
commit a491ef2093
813 changed files with 345031 additions and 0 deletions

View file

@ -0,0 +1,184 @@
# This file was generated automatically by Trang, and then manually
# edited to add back definitions for overridden parameter entities and
# undefined elements, specifically: bodyatt, secur, paracon,
# tbl.table.mdl, tbl.entry.mdl, caution, graphic, legend, note, para,
# title, warning. This makes the semantics of this module as close as
# possible to the original DTD and also allows this schema to be used
# independently of DocBook.
# ......................................................................
# DocBook CALS Table Model V4.2 ........................................
# File calstblx.mod ....................................................
# Copyright 1992-2002 HaL Computer Systems, Inc.,
# O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
# Corporation, Norman Walsh, Sun Microsystems, Inc., and the
# Organization for the Advancement of Structured Information
# Standards (OASIS).
#
# This DTD is based on the CALS Table Model
# PUBLIC "-//USA-DOD//DTD Table Model 951010//EN"
#
# $Id: calstbl.rnc,v 1.2 2003/08/30 06:04:02 jjc Exp $
#
# Permission to use, copy, modify and distribute the DocBook DTD
# and its accompanying documentation for any purpose and without fee
# is hereby granted in perpetuity, provided that the above copyright
# notice and this paragraph appear in all copies. The copyright
# holders make no representation about the suitability of the DTD for
# any purpose. It is provided "as is" without expressed or implied
# warranty.
#
# If you modify the DocBook DTD in any way, except for declaring and
# referencing additional sets of general entities and declaring
# additional notations, label your DTD as a variant of DocBook. See
# the maintenance documentation for more information.
#
# Please direct all questions, bug reports, or suggestions for
# changes to the docbook@lists.oasis-open.org mailing list. For more
# information, see http://www.oasis-open.org/docbook/.
# ......................................................................
# This module contains the definitions for the CALS Table Model
# converted to XML.
# These definitions are not directly related to the table model, but are
# used in the default CALS table model and are usually defined elsewhere
# (and prior to the inclusion of this table module) in a CALS DTD.
bodyatt = empty
secur = empty
# no if zero(s),
# yes if any other digits value
yesorno = string
titles = title?
# default for use in entry content
paracon = text
# The parameter entities as defined below provide the CALS table model
# as published (as part of the Example DTD) in MIL-HDBK-28001.
#
# These following declarations provide the CALS-compliant default definitions
# for these entities. However, these entities can and should be redefined
# (by giving the appropriate parameter entity declaration(s) prior to the
# reference to this Table Model declaration set entity) to fit the needs
# of the current application.
tbl.table-titles.mdl = titles
tbl.table-main.mdl = tgroup+ | graphic+
tbl.table.mdl = tbl.table-titles.mdl | tbl.table-main.mdl
tbl.table.att =
attribute tabstyle { text }?,
attribute tocentry { yesorno }?,
attribute shortentry { yesorno }?,
attribute orient { "port" | "land" }?,
attribute pgwide { yesorno }?
tbl.tgroup.mdl = colspec*, spanspec*, thead?, tfoot?, tbody
tbl.tgroup.att = attribute tgroupstyle { text }?
tbl.hdft.mdl = colspec*, row+
tbl.row.mdl = (entry | entrytbl)+
tbl.entrytbl.mdl = colspec*, spanspec*, thead?, tbody
tbl.entry.mdl = paracon | para | warning | caution | note | legend
# ===== Element and attribute declarations follow. =====
start = table
table = element table { table.attlist, tbl.table.mdl }
table.attlist &=
attribute frame {
"top" | "bottom" | "topbot" | "all" | "sides" | "none"
}?,
attribute colsep { yesorno }?,
attribute rowsep { yesorno }?,
tbl.table.att,
bodyatt,
secur
tgroup = element tgroup { tgroup.attlist, tbl.tgroup.mdl }
tgroup.attlist &=
attribute cols { text },
tbl.tgroup.att,
attribute colsep { yesorno }?,
attribute rowsep { yesorno }?,
attribute align { "left" | "right" | "center" | "justify" | "char" }?,
attribute char { text }?,
attribute charoff { text }?,
secur
colspec = element colspec { colspec.attlist, empty }
colspec.attlist &=
attribute colnum { text }?,
attribute colname { text }?,
attribute colwidth { text }?,
attribute colsep { yesorno }?,
attribute rowsep { yesorno }?,
attribute align { "left" | "right" | "center" | "justify" | "char" }?,
attribute char { text }?,
attribute charoff { text }?
spanspec = element spanspec { spanspec.attlist, empty }
spanspec.attlist &=
attribute namest { text },
attribute nameend { text },
attribute spanname { text },
attribute colsep { yesorno }?,
attribute rowsep { yesorno }?,
attribute align { "left" | "right" | "center" | "justify" | "char" }?,
attribute char { text }?,
attribute charoff { text }?
thead = element thead { thead.attlist, tbl.hdft.mdl }
thead.attlist &=
attribute valign { "top" | "middle" | "bottom" }?,
secur
tfoot = element tfoot { tfoot.attlist, tbl.hdft.mdl }
tfoot.attlist &=
attribute valign { "top" | "middle" | "bottom" }?,
secur
tbody = element tbody { tbody.attlist, row+ }
tbody.attlist &=
attribute valign { "top" | "middle" | "bottom" }?,
secur
row = element row { row.attlist, tbl.row.mdl }
row.attlist &=
attribute rowsep { yesorno }?,
attribute valign { "top" | "middle" | "bottom" }?,
secur
entrytbl = element entrytbl { entrytbl.attlist, tbl.entrytbl.mdl }
entrytbl.attlist &=
attribute cols { text },
tbl.tgroup.att,
attribute colname { text }?,
attribute spanname { text }?,
attribute namest { text }?,
attribute nameend { text }?,
attribute colsep { yesorno }?,
attribute rowsep { yesorno }?,
attribute align { "left" | "right" | "center" | "justify" | "char" }?,
attribute char { text }?,
attribute charoff { text }?,
secur
entry = element entry { entry.attlist, tbl.entry.mdl* }
entry.attlist &=
attribute colname { text }?,
attribute namest { text }?,
attribute nameend { text }?,
attribute spanname { text }?,
attribute morerows { text }?,
attribute colsep { yesorno }?,
attribute rowsep { yesorno }?,
attribute align { "left" | "right" | "center" | "justify" | "char" }?,
attribute char { text }?,
attribute charoff { text }?,
attribute rotate { yesorno }?,
attribute valign { "top" | "middle" | "bottom" }?,
secur
caution |= notAllowed
graphic |= notAllowed
legend |= notAllowed
note |= notAllowed
para |= notAllowed
title |= notAllowed
warning |= notAllowed
# End of DocBook CALS Table Model V4.2 .................................
# ......................................................................

View file

@ -0,0 +1,25 @@
# Definitions specific to the CALS Table Model.
# Reference CALS Table Model
include "calstbl.rnc" {
# Override definition of start
start |= notAllowed
# Add label and role attributes to table and informaltable
bodyatt = label.attrib
# Add common attributes to Table, TGroup, TBody, THead, TFoot, Row,
# EntryTbl, and Entry (and InformalTable element).
secur = common.attrib, tables.role.attrib
# Content model for Table.
tbl.table.mdl =
blockinfo?,
formalobject.title.content,
ndxterm.class*,
textobject*,
(graphic+ | mediaobject+ | tgroup+)
# Allow either objects or inlines; beware of REs between elements.
tbl.entry.mdl = para.char.mix | tabentry.mix
}
common.table.attribs = bodyatt, secur
# end of table.module

View file

@ -0,0 +1,116 @@
# This is an alternative to dbsoextbl.rnc and dbcalstbl.rnc that
# allows the table model to be selected dynamically based on the
# definitions of cals.table.module and exchange.table.module.
#
# To use this copy, docbook.rnc to docbook-dyntbl.rnc replacing
# "dbcalstbl.rnc" by "dbdyntbl.rnc". Then, you can override the
# choice of table model by doing
#
# include "docbook-dyntbl.rnc" {
# cals.table.model = IGNORE
# exchange.table.model = INCLUDE
# }
INCLUDE = empty
IGNORE = notAllowed
cals.table.module = INCLUDE
exchange.table.module = IGNORE
# Add common attributes and the Label attribute to Table and
# InformalTable.
bodyatt = common.attrib, label.attrib, tables.role.attrib
# Content model for Table.
tbl.table.mdl =
blockinfo?,
formalobject.title.content,
ndxterm.class*,
textobject*,
(graphic+ | mediaobject+ | tgroup+)
table = cals.table | exchange.table
cals.table =
cals.table.module,
grammar {
# Reference CALS Table Model
include "calstbl.rnc" {
# Add label and role attributes to table and informaltable
bodyatt = parent label.attrib
# Add common attributes to Table, TGroup, TBody, THead, TFoot, Row,
# EntryTbl, and Entry (and InformalTable element).
secur = parent common.attrib, parent tables.role.attrib
tbl.table.mdl = parent tbl.table.mdl
}
}
exchange.table =
exchange.table.module,
grammar {
# Reference OASIS Exchange Table Model
include "soextbl.rnc" {
# Add common attributes and the Label attribute to Table and
# InformalTable.
bodyatt = parent bodyatt
tbl.table.mdl = parent tbl.table.mdl
}
}
tgroup = cals.tgroup | exchange.tgroup
cals.tgroup =
cals.table.module,
grammar {
# Reference CALS Table Model
include "calstbl.rnc" {
start = tgroup
# Add label and role attributes to table and informaltable
bodyatt = parent label.attrib
# Add common attributes to Table, TGroup, TBody, THead, TFoot, Row,
# EntryTbl, and Entry (and InformalTable element).
secur = parent common.attrib, parent tables.role.attrib
# Allow either objects or inlines; beware of REs between elements.
tbl.entry.mdl = parent para.char.mix | parent tabentry.mix
}
}
exchange.tgroup =
exchange.table.module,
grammar {
# Reference OASIS Exchange Table Model
include "soextbl.rnc" {
start = tgroup
bodyatt = parent bodyatt
# Add common attributes to TGroup, ColSpec, TBody, THead, Row, Entry
tbl.tgroup.att = parent common.attrib
tbl.colspec.att = parent common.attrib
tbl.tbody.att = parent common.attrib
tbl.thead.att = parent common.attrib
tbl.row.att = parent common.attrib
tbl.entry.att = parent common.attrib
# Allow either objects or inlines; beware of REs between elements.
tbl.entry.mdl = (parent para.char.mix | parent tabentry.mix)*
}
}
tbl.table.att = cals.tbl.table.att | exchange.tbl.table.att
cals.tbl.table.att =
cals.table.module,
grammar {
include "calstbl.rnc" {
start = tbl.table.att
}
}
exchange.tbl.table.att =
exchange.table.module,
grammar {
include "soextbl.rnc" {
start = tbl.table.att
}
}
common.table.attribs = bodyatt
# end of table.module

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,84 @@
# ......................................................................
# DocBook notations module V4.2 ........................................
# File dbnotnx.mod .....................................................
# Copyright 1992-2002 HaL Computer Systems, Inc.,
# O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
# Corporation, Norman Walsh, Sun Microsystems, Inc., and the
# Organization for the Advancement of Structured Information
# Standards (OASIS).
#
# $Id: dbnotn.rnc,v 1.1 2003/08/30 04:19:27 jjc Exp $
#
# Permission to use, copy, modify and distribute the DocBook DTD
# and its accompanying documentation for any purpose and without fee
# is hereby granted in perpetuity, provided that the above copyright
# notice and this paragraph appear in all copies. The copyright
# holders make no representation about the suitability of the DTD for
# any purpose. It is provided "as is" without expressed or implied
# warranty.
#
# If you modify the DocBook DTD in any way, except for declaring and
# referencing additional sets of general entities and declaring
# additional notations, label your DTD as a variant of DocBook. See
# the maintenance documentation for more information.
#
# Please direct all questions, bug reports, or suggestions for
# changes to the docbook@lists.oasis-open.org mailing list. For more
# information, see http://www.oasis-open.org/docbook/.
# ......................................................................
# This module contains the entity declarations for the standard ISO
# entity sets used by DocBook.
#
# In DTD driver files referring to this module, please use an entity
# declaration that uses the public identifier shown below:
#
# <!ENTITY % dbnotn PUBLIC
# "-//OASIS//ENTITIES DocBook Notations V4.2//EN"
# "dbnotnx.mod">
# %dbnotn;
#
# See the documentation for detailed information on the parameter
# entity and module scheme used in DocBook, customizing DocBook and
# planning for interchange, and changes made since the last release
# of DocBook.
local.notation.class = notAllowed
notation.class =
"BMP"
| "CGM-CHAR"
| "CGM-BINARY"
| "CGM-CLEAR"
| "DITROFF"
| "DVI"
| "EPS"
| "EQN"
| "FAX"
| "GIF"
| "GIF87a"
| "GIF89a"
| "JPG"
| "JPEG"
| "IGES"
| "PCX"
| "PIC"
| "PNG"
| "PS"
| "SGML"
| "TBL"
| "TEX"
| "TIFF"
| "WMF"
| "WPG"
| "SVG"
| "linespecific"
| local.notation.class
# WordPerfect Graphic format
# End of DocBook notations module V4.2 .................................
# ......................................................................

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,30 @@
# Definitions specific to the OASIS XML Exchange Table Model.
# Reference OASIS Exchange Table Model
include "soextbl.rnc" {
# Override definition of start
start |= notAllowed
# Add common attributes and the Label attribute to Table and
# InformalTable.
bodyatt = common.attrib, label.attrib, tables.role.attrib
# Add common attributes to TGroup, ColSpec, TBody, THead, Row, Entry
tbl.tgroup.att = common.attrib
tbl.colspec.att = common.attrib
tbl.tbody.att = common.attrib
tbl.thead.att = common.attrib
tbl.row.att = common.attrib
tbl.entry.att = common.attrib
# Content model for Table.
tbl.table.mdl =
blockinfo?,
formalobject.title.content,
ndxterm.class*,
textobject*,
(graphic+ | mediaobject+ | tgroup+)
# Allow either objects or inlines; beware of REs between elements.
tbl.entry.mdl = (para.char.mix | tabentry.mix)*
}
common.table.attribs = bodyatt
# end of table.module

View file

@ -0,0 +1,23 @@
# This choice of root elements comes from the 1.0b1 RNG schema at
# http://www.oasis-open.org/docbook/relaxng/1.0b1/index.shtml
start =
set
| setindex
| book
| part
| reference
| preface
| chapter
| appendix
| article
| bibliography
| glossary
| index
| refentry
| sect1
| sect2
| sect3
| sect4
| sect5
| section

View file

@ -0,0 +1,18 @@
# Variant of docbook.rnc that allows the table model to be selected
# dynamically based on the definitions of cals.table.module and
# exchange.table.module. See dbdyntbl.rnc.
# Document (root) elements
include "dbstart.rnc"
# Notation declarations
include "dbnotn.rnc"
# Information pool
include "dbpool.rnc"
# Dynamic Table Model
include "dbdyntbl.rnc"
# Document hierarchy
include "dbhier.rnc"

View file

@ -0,0 +1,17 @@
# Variant of docbook.rnc that uses the OASIS XML Exchange Table Model
# rather than the CALS Table Model.
# Document (root) elements
include "dbstart.rnc"
# Notation declarations
include "dbnotn.rnc"
# Information pool
include "dbpool.rnc"
# OASIS XML Exchange Table Model
include "dbsoextbl.rnc"
# Document hierarchy
include "dbhier.rnc"

View file

@ -0,0 +1,48 @@
# Unofficial DocBook RELAX NG Compact Syntax schema
# This file was generated automatically by Trang
# (http://www.thaiopensource.com/relaxng/trang.html) from the DocBook
# XML DTD V4.2 (http://www.oasis-open.org/docbook/xml/4.2/), then
# changing the definition of start, changing the filenames,
# editing the comments and adding includes of dbstart.rnc
# and dbcalstbl.rnc.
# The following copyright applies to the DocBook XML DTD V4.2.
# Copyright 1992-2002 HaL Computer Systems, Inc.,
# O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
# Corporation, Norman Walsh, Sun Microsystems, Inc., and the
# Organization for the Advancement of Structured Information
# Standards (OASIS).
#
# Permission to use, copy, modify and distribute the DocBook XML DTD
# and its accompanying documentation for any purpose and without fee
# is hereby granted in perpetuity, provided that the above copyright
# notice and this paragraph appear in all copies. The copyright
# holders make no representation about the suitability of the DTD for
# any purpose. It is provided "as is" without expressed or implied
# warranty.
#
# If you modify the DocBook DTD in any way, except for declaring and
# referencing additional sets of general entities and declaring
# additional notations, label your DTD as a variant of DocBook. See
# the maintenance documentation for more information.
#
# Please direct all questions, bug reports, or suggestions for
# changes to the docbook@lists.oasis-open.org mailing list. For more
# information, see http://www.oasis-open.org/docbook/.
# Document (root) elements
include "dbstart.rnc"
# Notation declarations
include "dbnotn.rnc"
# Information pool
include "dbpool.rnc"
# CALS Table Model
include "dbcalstbl.rnc"
# Document hierarchy
include "dbhier.rnc"

View file

@ -0,0 +1,200 @@
default namespace this = "http://thaiopensource.com/ns/locating-rules/1.0"
namespace local = ""
start = locatingRules
locatingRules = element locatingRules { common, rule* }
rule =
\include
# | group
| applyFollowingRules
| documentElement
# | doctypePublicId
| \namespace
| uri
| transformURI
# | typeIdProcessingInstruction
| \default
| typeId
# | typeIdBase
| extensionRule
## Group of rules. Useful with xml:base.
group = element group { common, rule* }
\include =
element include {
common,
attribute rules { xsd:anyURI }
}
applyFollowingRules =
element applyFollowingRules {
common,
attribute ruleType {
"documentElement"
| "doctypePublicId"
| "namespace"
| "uri"
| "transformURI"
| "typeIdProcessingInstruction"
| "default"
}
}
documentElement =
## Matches if the prefix and/or local name of document element
## match the values of the prefix and localName attributes.
element documentElement {
common,
nameAtts,
targetAtt
}
## If there's no prefix attribute, then only the local name must match.
## If there's no local name attribute, then only the prefix must match.
nameAtts = (prefixAtt, localNameAtt?) | localNameAtt
## prefix="" matches if the document element has no prefix.
prefixAtt = attribute prefix { (xsd:NCName - "xmlns") | "" }
localNameAtt = attribute localName { xsd:NCName - "xmlns" }
doctypePublicId =
## Matches if the document has a DOCTYPE declaration with a public
## identifier that, after normalization, matches the value of the
## publicId attribute.
element doctypePublicId {
common,
attribute publicId { publicIdValue },
targetAtt
}
publicIdValue =
xsd:token {
## Newline and tab are excluded, because pattern applies to
## the post-normalization value.
pattern = "[\-'()+,./:=?;!*#@$_%a-zA-Z0-9 ]*"
}
# This is separate from documentElement so it can be distinguished
# by applyFollowingRules.
\namespace =
## Matches if the document element has a namespace URI equal to the value
## of the ns attribute. A document element with no namespace matches if
## the value of the ns attribute is the empty string.
element namespace {
common,
attribute ns { xsd:string },
targetAtt
}
uri =
## Matches based on the URI of the document.
element uri {
common,
(resourceAtt | patternAtt),
targetAtt
}
## Matches if it can be determined that the document resource is
## the same resource as that identified by the value of the resource
## attribute. In determining this, the implementation should apply
## the semantics of the URI scheme used by the URI.
resourceAtt = attribute resource { xsd:anyURI }
## Matches if the document's URI matches the pattern specified
## by the pattern attribute. A * in the path component matches
## zero or more characters other than / (after resolving escapes).
## If the pattern is a relative URI, it means that there must
## be some URI such that when the pattern is resolved relative
## to that URI, it matches the document's URI. Thus an empty
## pattern will always match.
patternAtt = attribute pattern { uriPattern }
## A pattern for a URI. Same syntax as a URI, except that a * in
## the path component has a special meaning.
uriPattern = xsd:anyURI
transformURI =
## Generates a URI for the related resource by transforming
## the URI of the document. Matches if the transformation
## yields a valid URI that identifies an existing resource.
element transformURI {
common,
## Semantics are the same as the pattern attribute of the uri element.
attribute fromPattern { uriPattern },
## The result of the transformation is produced from the toPattern
## by replacing each * by the string that matched the corresponding
## * in the toPattern. The toPattern is appended to the initial
## part of the document's URI that was not explicitly matched
## by fromPattern.
attribute toPattern { uriPattern }
}
\default =
## Always matches.
element default {
common,
targetAtt
}
## A document can be mapped onto a URI either indirectly via a typeId
## or directly.
targetAtt = uriAtt | typeIdAtt
## Specifies the URI of the related resource.
## xml:base is used if it's relative.
uriAtt = attribute uri { xsd:anyURI }
## Specifies an identifier of the type of document. typeId and
## typeIdBase rules will be used to map this to a URI.
typeIdAtt = attribute typeId { typeIdValue }
## A type identifier can be anything convenient (e.g. a public identifier,
## a URL or just a string with no formal structure). Whitespace is
## normalized like a public identifier before comparing type identifiers
## for equality.
typeIdValue = xsd:token
typeIdProcessingInstruction =
## Matches if there's a processing instruction in the prolog
## before any DOCTYPE declaration whose target is the value of
## the target attribute. The value of the processing instruction
## is interpreted as a typeId, which will be mapped to a
## URI as normal.
element typeIdProcessingInstruction {
common,
attribute target { xsd:NCName }
}
typeId =
## Maps a typeId onto a URI.
element typeId {
common,
attribute id { typeIdValue },
targetAtt
}
typeIdBase =
## Used to map a typeId onto a URI. First, any URI reserved characters
## are URI encoded. If the append attribute is specified, it is appended.
## This is then treated as a URI. If relative, it is resolved using
## the applicable base URI as usual. If the resulting URI identifies
## an existing resource, then the typeId is mapped to this resource.
## This is intended to be useful with file URIs.
element typeIdBase {
common,
attribute append { xsd:string }?
}
extensionRule =
element * - this:* {
attribute * { text }*, (text|anyElement)*
}
anyElement = element * { attribute * { text }*, (text|anyElement)* }
common =
# attribute xml:base { xsd:anyURI }?,
attribute * - (xml:base|this:*|local:*) { text }*

View file

@ -0,0 +1,205 @@
#
# RELAX NG Compact Schema for RDF/XML Syntax
#
# This schema is for information only and NON-NORMATIVE
#
# It is based on one originally written by James Clark in
# http://lists.w3.org/Archives/Public/www-rdf-comments/2001JulSep/0248.html
# and updated with later changes.
#
namespace local = ""
namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
start = doc
# I cannot seem to do this in RNGC so they are expanded in-line
# coreSyntaxTerms = rdf:RDF | rdf:ID | rdf:about | rdf:parseType | rdf:resource | rdf:nodeID | rdf:datatype
# syntaxTerms = coreSyntaxTerms | rdf:Description | rdf:li
# oldTerms = rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID
# nodeElementURIs = * - ( coreSyntaxTerms | rdf:li | oldTerms )
# propertyElementURIs = * - ( coreSyntaxTerms | rdf:Description | oldTerms )
# propertyAttributeURIs = * - ( coreSyntaxTerms | rdf:Description | rdf:li | oldTerms )
# Also needed to allow rdf:li on all property element productions
# since we can't capture the rdf:li rewriting to rdf_<n> in relaxng
# Need to add these explicitly
xmllang = attribute xml:lang { text }
xmlbase = attribute xml:base { text }
# and to forbid every other xml:* attribute, element
doc =
RDF
RDF =
element rdf:RDF {
xmllang?, xmlbase?, nodeElementList
}
nodeElementList =
nodeElement*
# Should be something like:
# ws* , ( nodeElement , ws* )*
# but RELAXNG does this by default, ignoring whitespace separating tags.
nodeElement =
element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
rdf:resource | rdf:nodeID | rdf:datatype | rdf:li |
rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID ) {
(idAttr | nodeIdAttr | aboutAttr )?, xmllang?, xmlbase?, propertyAttr*, propertyEltList
}
# It is not possible to say "and not things
# beginning with _ in the rdf: namespace" in RELAX NG.
ws =
" "
# Not used in this RELAX NG schema; but should be any legal XML
# whitespace defined by http://www.w3.org/TR/2000/REC-xml-20001006#NT-S
propertyEltList =
propertyElt*
# Should be something like:
# ws* , ( propertyElt , ws* )*
# but RELAXNG does this by default, ignoring whitespace separating tags.
propertyElt =
resourcePropertyElt |
literalPropertyElt |
parseTypeLiteralPropertyElt |
parseTypeResourcePropertyElt |
parseTypeCollectionPropertyElt |
parseTypeOtherPropertyElt |
emptyPropertyElt
resourcePropertyElt =
element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
rdf:resource | rdf:nodeID | rdf:datatype |
rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
xml:* ) {
idAttr?, xmllang?, xmlbase?, nodeElement
}
literalPropertyElt =
element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
rdf:resource | rdf:nodeID | rdf:datatype |
rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
xml:* ) {
(idAttr | datatypeAttr )?, xmllang?, xmlbase?, text
}
parseTypeLiteralPropertyElt =
element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
rdf:resource | rdf:nodeID | rdf:datatype |
rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
xml:* ) {
idAttr?, parseLiteral, xmllang?, xmlbase?, literal
}
parseTypeResourcePropertyElt =
element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
rdf:resource | rdf:nodeID | rdf:datatype |
rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
xml:* ) {
idAttr?, parseResource, xmllang?, xmlbase?, propertyEltList
}
parseTypeCollectionPropertyElt =
element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
rdf:resource | rdf:nodeID | rdf:datatype |
rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
xml:* ) {
idAttr?, xmllang?, xmlbase?, parseCollection, nodeElementList
}
parseTypeOtherPropertyElt =
element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
rdf:resource | rdf:nodeID | rdf:datatype |
rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
xml:* ) {
idAttr?, xmllang?, xmlbase?, parseOther, any
}
emptyPropertyElt =
element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
rdf:resource | rdf:nodeID | rdf:datatype |
rdf:Description | rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID |
xml:* ) {
idAttr?, (resourceAttr | nodeIdAttr)?, xmllang?, xmlbase?, propertyAttr*
}
idAttr =
attribute rdf:ID {
IDsymbol
}
nodeIdAttr =
attribute rdf:nodeID {
IDsymbol
}
aboutAttr =
attribute rdf:about {
URI-reference
}
propertyAttr =
attribute * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
rdf:resource | rdf:nodeID | rdf:datatype | rdf:li |
rdf:Description | rdf:aboutEach |
rdf:aboutEachPrefix | rdf:bagID |
xml:* ) {
string
}
resourceAttr =
attribute rdf:resource {
URI-reference
}
datatypeAttr =
attribute rdf:datatype {
URI-reference
}
parseLiteral =
attribute rdf:parseType {
"Literal"
}
parseResource =
attribute rdf:parseType {
"Resource"
}
parseCollection =
attribute rdf:parseType {
"Collection"
}
parseOther =
attribute rdf:parseType {
text
}
URI-reference =
string
literal =
any
IDsymbol =
xsd:NMTOKEN
any =
mixed { element * { attribute * { text }*, any }* }

View file

@ -0,0 +1,63 @@
# RELAX NG XML syntax expressed in RELAX NG Compact syntax.
default namespace rng = "http://relaxng.org/ns/structure/1.0"
namespace local = ""
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
start = pattern
pattern =
element element { (nameQName | nameClass), (common & pattern+) }
| element attribute { (nameQName | nameClass), (common & pattern?) }
| element group|interleave|choice|optional
|zeroOrMore|oneOrMore|list|mixed { common & pattern+ }
| element ref|parentRef { nameNCName, common }
| element empty|notAllowed|text { common }
| element data { type, param*, (common & exceptPattern?) }
| element value { commonAttributes, type?, xsd:string }
| element externalRef { href, common }
| element grammar { common & grammarContent* }
param = element param { commonAttributes, nameNCName, xsd:string }
exceptPattern = element except { common & pattern+ }
grammarContent =
definition
| element div { common & grammarContent* }
| element include { href, (common & includeContent*) }
includeContent =
definition
| element div { common & includeContent* }
definition =
element start { combine?, (common & pattern+) }
| element define { nameNCName, combine?, (common & pattern+) }
combine = attribute combine { "choice" | "interleave" }
nameClass =
element name { commonAttributes, xsd:QName }
| element anyName { common & exceptNameClass? }
| element nsName { common & exceptNameClass? }
| element choice { common & nameClass+ }
exceptNameClass = element except { common & nameClass+ }
nameQName = attribute name { xsd:QName }
nameNCName = attribute name { xsd:NCName }
href = attribute href { xsd:anyURI }
type = attribute type { xsd:NCName }
common = commonAttributes, foreignElement*
commonAttributes =
attribute ns { xsd:string }?,
attribute datatypeLibrary { xsd:anyURI }?,
foreignAttribute*
foreignElement = element * - rng:* { (anyAttribute | text | anyElement)* }
foreignAttribute = attribute * - (rng:*|local:*) { text }
anyElement = element * { (anyAttribute | text | anyElement)* }
anyAttribute = attribute * { text }

View file

@ -0,0 +1,36 @@
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
<transformURI fromPattern="*.xml" toPattern="*.rnc"/>
<uri pattern="*.xsl" typeId="XSLT"/>
<uri pattern="*.html" typeId="XHTML"/>
<uri pattern="*.rng" typeId="RELAX NG"/>
<uri pattern="*.rdf" typeId="RDF"/>
<namespace ns="http://www.w3.org/1999/XSL/Transform" typeId="XSLT"/>
<namespace ns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" typeId="RDF"/>
<namespace ns="http://www.w3.org/1999/xhtml" typeId="XHTML"/>
<namespace ns="http://relaxng.org/ns/structure/1.0" typeId="RELAX NG"/>
<namespace ns="http://thaiopensource.com/ns/locating-rules/1.0"
uri="locate.rnc"/>
<documentElement localName="stylesheet" typeId="XSLT"/>
<documentElement prefix="xsl" localName="transform" typeId="XSLT"/>
<documentElement localName="html" typeId="XHTML"/>
<documentElement localName="grammar" typeId="RELAX NG"/>
<documentElement prefix="" localName="article" typeId="DocBook"/>
<documentElement prefix="" localName="book" typeId="DocBook"/>
<documentElement localName="RDF" typeId="RDF"/>
<documentElement prefix="rdf" typeId="RDF"/>
<documentElement localName="locatingRules" uri="locate.rnc"/>
<typeId id="XSLT" uri="xslt.rnc"/>
<typeId id="RELAX NG" uri="relaxng.rnc"/>
<typeId id="XHTML" uri="xhtml.rnc"/>
<typeId id="DocBook" uri="docbook.rnc"/>
<typeId id="RDF" uri="rdfxml.rnc"/>
</locatingRules>

View file

@ -0,0 +1,260 @@
# XML EXCHANGE TABLE MODEL DECLARATION MODULE
# This set of declarations defines the XML version of the Exchange
# Table Model as of the date shown in the Formal Public Identifier
# (FPI) for this entity.
#
# This set of declarations may be referred to using a public external
# entity declaration and reference as shown in the following three
# lines:
#
# <!ENTITY % calstblx
# PUBLIC "-//OASIS//DTD XML Exchange Table Model 19990315//EN">
# %calstblx;
#
# If various parameter entities used within this set of declarations
# are to be given non-default values, the appropriate declarations
# should be given before calling in this package (i.e., before the
# "%calstblx;" reference).
# The motivation for this XML version of the Exchange Table Model
# is simply to create an XML version of the SGML Exchange Table
# Model. By design, no effort has been made to "improve" the model.
#
# This XML version incorporates the logical bare minimum changes
# necessary to make the Exchange Table Model a valid XML DTD.
# The XML version of the Exchange Table Model differs from
# the SGML version in the following ways:
#
# The following parameter entities have been removed:
#
# - tbl.table.excep, tbl.hdft.excep, tbl.row.excep, tbl.entry.excep
# There are no exceptions in XML. The following normative statement
# is made in lieu of exceptions: the exchange table model explicitly
# forbids a table from occurring within another table. If the
# content model of an entry includes a table element, then this
# cannot be enforced by the DTD, but it is a deviation from the
# exchange table model to include a table within a table.
#
# - tbl.hdft.name, tbl.hdft.mdl, tbl.hdft.excep, tbl.hdft.att
# The motivation for these elements was to change the table
# header/footer elements. Since XML does not allow element declarations
# to contain name groups, and the exchange table model does not
# allow a table to contain footers, the continued presence of these
# attributes seems unnecessary.
#
# The following parameter entity has been added:
#
# - tbl.thead.att
# This entity parameterizes the attributes on thead. It replaces
# the tbl.hdft.att parameter entity.
#
# Other miscellaneous changes:
#
# - Tag ommission indicators have been removed
# - Comments have been removed from declarations
# - NUMBER attributes have been changed to NMTOKEN
# - NUTOKEN attributes have been to changed to NMTOKEN
# - Removed the grouping characters around the content model
# parameter entry for the 'entry' element. This is necessary
# so that an entry can contain #PCDATA and be defined as an
# optional, repeatable OR group beginning with #PCDATA.
# This entity includes a set of element and attribute declarations
# that partially defines the Exchange table model. However, the model
# is not well-defined without the accompanying natural language
# description of the semantics (meanings) of these various elements,
# attributes, and attribute values. The semantic writeup, also available
# from SGML Open, should be used in conjunction with this entity.
# In order to use the Exchange table model, various parameter entity
# declarations are required. A brief description is as follows:
#
# ENTITY NAME WHERE USED WHAT IT IS
#
# %yesorno In ATTLIST of: An attribute declared value
# almost all elements for a "boolean" attribute
#
# %paracon In content model of: The "text" (logical content)
# <entry> of the model group for <entry>
#
# %titles In content model of: The "title" part of the model
# table element group for the table element
#
# %tbl.table.name In declaration of: The name of the "table"
# table element element
#
# %tbl.table-titles.mdl In content model of: The model group for the title
# table elements part of the content model for
# table element
#
# %tbl.table.mdl In content model of: The model group for the content
# table elements model for table element,
# often (and by default) defined
# in terms of %tbl.table-titles.mdl
# and tgroup
#
# %tbl.table.att In ATTLIST of: Additional attributes on the
# table element table element
#
# %bodyatt In ATTLIST of: Additional attributes on the
# table element table element (for backward
# compatibility with the SGML
# model)
#
# %tbl.tgroup.mdl In content model of: The model group for the content
# <tgroup> model for <tgroup>
#
# %tbl.tgroup.att In ATTLIST of: Additional attributes on the
# <tgroup> <tgroup> element
#
# %tbl.thead.att In ATTLIST of: Additional attributes on the
# <thead> <thead> element
#
# %tbl.tbody.att In ATTLIST of: Additional attributes on the
# <tbody> <tbody> element
#
# %tbl.colspec.att In ATTLIST of: Additional attributes on the
# <colspec> <colspec> element
#
# %tbl.row.mdl In content model of: The model group for the content
# <row> model for <row>
#
# %tbl.row.att In ATTLIST of: Additional attributes on the
# <row> <row> element
#
# %tbl.entry.mdl In content model of: The model group for the content
# <entry> model for <entry>
#
# %tbl.entry.att In ATTLIST of: Additional attributes on the
# <entry> <entry> element
#
# This set of declarations will use the default definitions shown below
# for any of these parameter entities that are not declared before this
# set of declarations is referenced.
# These definitions are not directly related to the table model, but are
# used in the default CALS table model and may be defined elsewhere (and
# prior to the inclusion of this table module) in the referencing DTD.
yesorno = xsd:NMTOKEN
# no if zero(s), yes if any other value
pcd = text
paracon = pcd
# default for use in entry content
# The parameter entities as defined below change and simplify the CALS table
# model as published (as part of the Example DTD) in MIL-HDBK-28001. The
# resulting simplified DTD has support from the SGML Open vendors and is
# therefore more interoperable among different systems.
#
# These following declarations provide the Exchange default definitions
# for these entities. However, these entities can be redefined (by giving
# the appropriate parameter entity declaration(s) prior to the reference
# to this Table Model declaration set entity) to fit the needs of the
# current application.
#
# Note, however, that changes may have significant effect on the ability to
# interchange table information. These changes may manifest themselves
# in useability, presentation, and possible structure information degradation.
tbl.table-titles.mdl = title
tbl.table-main.mdl = tgroup+
tbl.table.mdl = tbl.table-titles.mdl | tbl.table-main.mdl
tbl.table.att = attribute pgwide { yesorno }?
bodyatt = empty
tbl.tgroup.mdl = colspec*, thead?, tbody
tbl.tgroup.att = empty
tbl.thead.att = empty
tbl.tbody.att = empty
tbl.colspec.att = empty
tbl.row.mdl = entry+
tbl.row.att = empty
tbl.entry.mdl = paracon*
tbl.entry.att = empty
# ===== Element and attribute declarations follow. =====
# Default declarations previously defined in this entity and
# referenced below include:
# ENTITY % tbl.table.name "table"
# ENTITY % tbl.table-titles.mdl "%titles;,"
# ENTITY % tbl.table.mdl "%tbl.table-titles; tgroup+"
# ENTITY % tbl.table.att "
# pgwide %yesorno; #IMPLIED "
table = element table { table.attlist, tbl.table.mdl }
table.attlist &=
attribute frame {
"top" | "bottom" | "topbot" | "all" | "sides" | "none"
}?,
attribute colsep { yesorno }?,
attribute rowsep { yesorno }?,
tbl.table.att,
bodyatt
# Default declarations previously defined in this entity and
# referenced below include:
# ENTITY % tbl.tgroup.mdl "colspec*,thead?,tbody"
# ENTITY % tbl.tgroup.att ""
tgroup = element tgroup { tgroup.attlist, tbl.tgroup.mdl }
tgroup.attlist &=
attribute cols { xsd:NMTOKEN },
attribute colsep { yesorno }?,
attribute rowsep { yesorno }?,
attribute align { "left" | "right" | "center" | "justify" | "char" }?,
tbl.tgroup.att
# Default declarations previously defined in this entity and
# referenced below include:
# ENTITY % tbl.colspec.att ""
colspec = element colspec { colspec.attlist, empty }
colspec.attlist &=
attribute colnum { xsd:NMTOKEN }?,
attribute colname { xsd:NMTOKEN }?,
attribute colwidth { text }?,
attribute colsep { yesorno }?,
attribute rowsep { yesorno }?,
attribute align { "left" | "right" | "center" | "justify" | "char" }?,
attribute char { text }?,
attribute charoff { xsd:NMTOKEN }?,
tbl.colspec.att
# Default declarations previously defined in this entity and
# referenced below include:
# ENTITY % tbl.thead.att ""
thead = element thead { thead.attlist, row+ }
thead.attlist &=
attribute valign { "top" | "middle" | "bottom" }?,
tbl.thead.att
# Default declarations previously defined in this entity and
# referenced below include:
# ENTITY % tbl.tbody.att ""
tbody = element tbody { tbody.attlist, row+ }
tbody.attlist &=
attribute valign { "top" | "middle" | "bottom" }?,
tbl.tbody.att
# Default declarations previously defined in this entity and
# referenced below include:
# ENTITY % tbl.row.mdl "entry+"
# ENTITY % tbl.row.att ""
row = element row { row.attlist, tbl.row.mdl }
row.attlist &=
attribute rowsep { yesorno }?,
attribute valign { "top" | "middle" | "bottom" }?,
tbl.row.att
# Default declarations previously defined in this entity and
# referenced below include:
# ENTITY % paracon "#PCDATA"
# ENTITY % tbl.entry.mdl "(%paracon;)*"
# ENTITY % tbl.entry.att ""
entry = element entry { entry.attlist, tbl.entry.mdl }
entry.attlist &=
attribute colname { xsd:NMTOKEN }?,
attribute namest { xsd:NMTOKEN }?,
attribute nameend { xsd:NMTOKEN }?,
attribute morerows { xsd:NMTOKEN }?,
attribute colsep { yesorno }?,
attribute rowsep { yesorno }?,
attribute align { "left" | "right" | "center" | "justify" | "char" }?,
attribute char { text }?,
attribute charoff { xsd:NMTOKEN }?,
attribute valign { "top" | "middle" | "bottom" }?,
tbl.entry.att
title |= notAllowed
start = table

View file

@ -0,0 +1,19 @@
# Applet Module
applet =
element applet {
applet.attlist,
# No restrictions on mixed content in TREX.
param*,
Flow.model
}
applet.attlist =
Core.attrib,
attribute alt { Text.datatype },
attribute archive { text }?,
attribute code { text }?,
attribute codebase { URI.datatype }?,
attribute object { text }?,
attribute height { Length.datatype },
attribute width { Length.datatype }
Inline.class |= applet

View file

@ -0,0 +1,14 @@
# Common Attributes Module
id.attrib = attribute id { ID.datatype }?
class.attrib = attribute class { NMTOKENS.datatype }?
title.attrib = attribute title { Text.datatype }?
Core.attrib = id.attrib, class.attrib, title.attrib
lang.attrib = attribute xml:lang { LanguageCode.datatype }?
I18n.attrib = lang.attrib
Common.attrib = Core.attrib, I18n.attrib
CommonIdRequired.attrib =
attribute id { ID.datatype },
class.attrib,
title.attrib,
I18n.attrib

View file

@ -0,0 +1,5 @@
# Base Module
base = element base { base.attlist }
base.attlist = attribute href { URI.datatype }
head.content &= base?

View file

@ -0,0 +1,63 @@
# Simplified Forms Module
form =
element form {
form.attlist,
# Don't use Block.model, because this gets redefined by the
# legacy module.
Block.class+
}
form.attlist =
Common.attrib,
attribute action { URI.datatype },
attribute method { "get" | "post" }?,
attribute enctype { ContentType.datatype }?
label = element label { label.attlist, Inline.model }
label.attlist =
Common.attrib,
attribute for { IDREF.datatype }?,
attribute accesskey { Character.datatype }?
input = element input { input.attlist }
input.attlist =
Common.attrib,
attribute type { InputType.class }?,
attribute name { text }?,
attribute value { text }?,
attribute checked { "checked" }?,
attribute size { text }?,
attribute maxlength { Number.datatype }?,
attribute src { URI.datatype }?,
attribute accesskey { Character.datatype }?
InputType.class =
"text"
| "password"
| "checkbox"
| "radio"
| "submit"
| "reset"
| "hidden"
select = element select { select.attlist, option+ }
select.attlist =
Common.attrib,
attribute name { text }?,
attribute size { Number.datatype }?,
attribute multiple { "multiple" }?
option =
element option {
Common.attrib,
attribute selected { "selected" }?,
attribute value { text }?,
text
}
textarea = element textarea { textarea.attlist }
textarea.attlist =
Common.attrib,
attribute name { text }?,
attribute rows { Number.datatype },
attribute cols { Number.datatype },
attribute accesskey { Character.datatype }?,
text
Form.class = form
Formctrl.class = input | label | select | textarea
Block.class |= Form.class
Inline.class |= Formctrl.class

View file

@ -0,0 +1,28 @@
# Basic Tables Module
table = element table { table.attlist, caption?, tr+ }
table.attlist =
Common.attrib,
attribute summary { Text.datatype }?
caption = element caption { caption.attlist, Inline.model }
caption.attlist = Common.attrib
tr = element tr { tr.attlist, (th | td)+ }
tr.attlist = Common.attrib, CellHAlign.attrib, CellVAlign.attrib
th = element th { th.attlist, Flow.model }
th.attlist = Cell.attrib
td = element td { td.attlist, Flow.model }
td.attlist = Cell.attrib
Cell.attrib =
Common.attrib,
attribute abbr { Text.datatype }?,
attribute axis { text }?,
attribute headers { IDREFS.datatype }?,
scope.attrib,
attribute rowspan { Number.datatype }?,
attribute colspan { Number.datatype }?,
CellHAlign.attrib,
CellVAlign.attrib
CellHAlign.attrib = attribute align { "left" | "center" | "right" }?
CellVAlign.attrib = attribute valign { "top" | "middle" | "bottom" }?
scope.attrib = attribute scope { "row" | "col" }?
Block.class |= table

View file

@ -0,0 +1,7 @@
# Bi-directional Module
bdo = element bdo { bdo.attlist, Inline.model }
bdo.attlist = Core.attrib, lang.attrib, dir.attrib
dir.attrib = attribute dir { "ltr" | "rtl" }
I18n.attrib &= dir.attrib?
Inline.class |= bdo

View file

@ -0,0 +1,29 @@
# Client-side Image Map Module
area = element area { area.attlist }
area.attlist =
Common.attrib,
attribute href { URI.datatype }?,
shape.attrib,
coords.attrib,
attribute nohref { "nohref" }?,
attribute alt { Text.datatype },
attribute tabindex { Number.datatype }?,
attribute accesskey { Character.datatype }?
map =
element map {
map.attlist,
(# This does not use Block.mix
# because loose.dtd doesn't use %Flow;
Block.class
| area)+
}
map.attlist = CommonIdRequired.attrib
a.attlist &= shape.attrib, coords.attrib
img.attlist &= usemap.attlist
object.attlist &= usemap.attlist
usemap.attlist = attribute usemap { IDREF.datatype }?
shape.attrib =
attribute shape { "rect" | "circle" | "poly" | "default" }?
coords.attrib = attribute coords { text }?
Inline.class |= map

View file

@ -0,0 +1,47 @@
# Datatypes Module
# Length defined for cellpadding/cellspacing
# nn for pixels or nn% for percentage length
Length.datatype = text
# space-separated list of link types
LinkTypes.datatype = NMTOKENS.datatype
# single or comma-separated list of media descriptors
MediaDesc.datatype = text
# pixel, percentage, or relative
MultiLength.datatype = text
# one or more digits (NUMBER)
Number.datatype = text
# integer representing length in pixels
Pixels.datatype = text
# script expression
Script.datatype = text
# textual content
Text.datatype = text
# Imported Datatypes ................................
# a single character from [ISO10646]
Character.datatype = text
# a character encoding, as per [RFC2045]
Charset.datatype = text
# a space separated list of character encodings, as per [RFC2045]
Charsets.datatype = text
# media type, as per [RFC2045]
ContentType.datatype = text
# comma-separated list of media types, as per [RFC2045]
ContentTypes.datatype = text
# date and time information. ISO date format
Datetime.datatype = text
# formal public identifier, as per [ISO8879]
FPI.datatype = text
# a language code, as per [RFC1766]
LanguageCode.datatype = xsd:language
# a Uniform Resource Identifier, see [URI]
URI.datatype = xsd:anyURI
# a space-separated list of Uniform Resource Identifiers, see [URI]
URIs.datatype = text
NMTOKEN.datatype = xsd:NMTOKEN
NMTOKENS.datatype = xsd:NMTOKENS
ID.datatype = xsd:ID
IDREF.datatype = xsd:IDREF
IDREFS.datatype = xsd:IDREFS

View file

@ -0,0 +1,12 @@
# Edit Module
del = element del { del.attlist, Inline.model }
del.attlist = Edit.attrib
ins = element ins { ins.attlist, Inline.model }
ins.attlist = Edit.attrib
Edit.attrib =
attribute cite { URI.datatype }?,
attribute datetime { Datetime.datatype }?
Edit.class = del | ins
Inline.class |= Edit.class
Block.class |= Edit.class

View file

@ -0,0 +1,47 @@
# Events Module
a.attlist &=
attribute onblur { Script.datatype }?,
attribute onfocus { Script.datatype }?
area.attlist &=
attribute onblur { Script.datatype }?,
attribute onfocus { Script.datatype }?
form.attlist &=
attribute onreset { Script.datatype }?,
attribute onsubmit { Script.datatype }?
body.attlist &=
attribute onload { Script.datatype }?,
attribute onunload { Script.datatype }?
label.attlist &=
attribute onblur { Script.datatype }?,
attribute onfocus { Script.datatype }?
input.attlist &=
attribute onblur { Script.datatype }?,
attribute onchange { Script.datatype }?,
attribute onfocus { Script.datatype }?,
attribute onselect { Script.datatype }?
select.attlist &=
attribute onblur { Script.datatype }?,
attribute onchange { Script.datatype }?,
attribute onfocus { Script.datatype }?
textarea.attlist &=
attribute onblur { Script.datatype }?,
attribute onchange { Script.datatype }?,
attribute onfocus { Script.datatype }?,
attribute onselect { Script.datatype }?
button.attlist &=
attribute onblur { Script.datatype }?,
attribute onfocus { Script.datatype }?
Events.attrib =
attribute onclick { Script.datatype }?,
attribute ondblclick { Script.datatype }?,
attribute onmousedown { Script.datatype }?,
attribute onmouseup { Script.datatype }?,
attribute onmouseover { Script.datatype }?,
attribute onmousemove { Script.datatype }?,
attribute onmouseout { Script.datatype }?,
attribute onkeypress { Script.datatype }?,
attribute onkeydown { Script.datatype }?,
attribute onkeyup { Script.datatype }?
Common.attrib &= Events.attrib
CommonIdRequired.attrib &= Events.attrib

View file

@ -0,0 +1,49 @@
# Forms Module
# Unlike the DTD implementation, this builds on the basic-form module
include "xhtml-basic-form.rnc" {
select = element select { select.attlist, (option | optgroup)+ }
}
form.attlist &=
attribute accept-charset { Charsets.datatype }?,
attribute accept { ContentTypes.datatype }?
input.attlist &=
attribute disabled { "disabled" }?,
attribute readonly { "readonly" }?,
attribute alt { text }?,
attribute tabindex { Number.datatype }?,
attribute accept { ContentTypes.datatype }?
InputType.class |= "image" | "button"
select.attlist &=
attribute disabled { "disabled" }?,
attribute tabindex { Number.datatype }?
option.attlist &=
attribute disabled { "disabled" }?,
attribute label { Text.datatype }?
optgroup = element optgroup { optgroup.attlist, option+ }
optgroup.attlist =
Common.attrib,
attribute disabled { "disabled" }?,
attribute label { Text.datatype }
textarea.attlist &=
attribute disabled { "disabled" }?,
attribute readonly { "readonly" }?,
attribute tabindex { Number.datatype }?
fieldset = element fieldset { fieldset.attlist, legend, Flow.model }
fieldset.attlist = Common.attrib
button = element button { button.attlist, Flow.model }
button.attlist =
Common.attrib,
attribute name { text }?,
attribute value { text }?,
attribute type { "button" | "submit" | "reset" }?,
attribute disabled { "disabled" }?,
attribute tabindex { Number.datatype }?,
attribute accesskey { Character.datatype }?
legend = element legend { legend.attlist, Inline.model }
legend.attlist =
Common.attrib,
attribute accesskey { Character.datatype }?
Form.class |= fieldset
Formctrl.class |= button

View file

@ -0,0 +1,26 @@
# Frames Module
include "xhtml-struct.rnc" {
html = element html { html.attlist, head, frameset }
}
frameset =
element frameset {
frameset.attlist,
((frameset | frame)+ & noframes?)
}
frameset.attlist =
Core.attrib,
attribute cols { MultiLength.datatype }?,
attribute rows { MultiLength.datatype }?
frame = element frame { frame.attlist }
frame.attlist =
Core.attrib,
attribute longdesc { URI.datatype }?,
attribute src { URI.datatype }?,
attribute frameborder { "1" | "0" }?,
attribute marginwidth { Pixels.datatype }?,
attribute marginheight { Pixels.datatype }?,
attribute noresize { "noresize" }?,
attribute scrolling { "yes" | "no" | "auto" }?
noframes = element noframes { noframes.attlist, body }
noframes.attlist = Common.attrib

View file

@ -0,0 +1,16 @@
# Hypertext Module
# Depends on text module.
a = element a { a.attlist, Inline.model }
a.attlist =
Common.attrib,
attribute href { URI.datatype }?,
attribute charset { Charset.datatype }?,
attribute type { ContentType.datatype }?,
attribute hreflang { LanguageCode.datatype }?,
attribute rel { LinkTypes.datatype }?,
attribute rev { LinkTypes.datatype }?,
attribute accesskey { Character.datatype }?,
attribute tabindex { Number.datatype }?
Inline.class |= a

View file

@ -0,0 +1,14 @@
# Iframe Module
iframe = element iframe { iframe.attlist, Flow.model }
iframe.attlist =
Core.attrib,
attribute longdesc { URI.datatype }?,
attribute src { URI.datatype }?,
attribute frameborder { "1" | "0" }?,
attribute width { Length.datatype }?,
attribute height { Length.datatype }?,
attribute marginwidth { Pixels.datatype }?,
attribute marginheight { Pixels.datatype }?,
attribute scrolling { "yes" | "no" | "auto" }?
Inline.class |= iframe

View file

@ -0,0 +1,11 @@
# Image Module
img = element img { img.attlist }
img.attlist =
Common.attrib,
attribute src { URI.datatype },
attribute alt { Text.datatype },
attribute longdesc { URI.datatype }?,
attribute height { Length.datatype }?,
attribute width { Length.datatype }?
Inline.class |= img

View file

@ -0,0 +1,3 @@
# Inline Style Module
Core.attrib &= attribute style { text }?

View file

@ -0,0 +1,100 @@
# Legacy Module
lang.attrib &= attribute lang { LanguageCode.datatype }?
basefont = element basefont { basefont.attlist }
basefont.attlist = id.attrib, Font.attrib
center = element center { center.attlist, Flow.model }
center.attlist = Common.attrib
font = element font { font.attlist, Inline.model }
font.attlist = Core.attrib, I18n.attrib, Font.attrib
Font.attrib =
attribute size { text }?,
attribute color { Color.datatype }?,
attribute face { text }?
s = element s { s.attlist, Inline.model }
s.attlist = Common.attrib
strike = element strike { strike.attlist, Inline.model }
strike.attlist = Common.attrib
u = element u { u.attlist, Inline.model }
u.attlist = Common.attrib
dir = element dir { dir.attlist, li.noblock+ }
dir.attlist =
Common.attrib,
attribute compact { "compact" }?
menu = element menu { menu.attlist, li.noblock+ }
menu.attlist =
Common.attrib,
attribute compact { "compact" }?
li.noblock = element li { li.attlist, Inline.model }
isindex = element isindex { isindex.attlist }
isindex.attlist =
Core.attrib,
I18n.attrib,
attribute prompt { Text.datatype }?
applet.attlist &=
attribute align { "top" | "middle" | "bottom" | "left" | "right" }?,
attribute hspace { Pixels.datatype }?,
attribute vspace { Pixels.datatype }?
body.attlist &=
attribute background { URI.datatype }?,
attribute bgcolor { Color.datatype }?,
attribute text { Color.datatype }?,
attribute link { Color.datatype }?,
attribute vlink { Color.datatype }?,
attribute alink { Color.datatype }?
br.attlist &= attribute clear { "left" | "all" | "right" | "none" }?
caption.attlist &= align.attrib
div.attlist &= align.attrib
# Not in the CR, but surely an error.
dl.attlist &= attribute compact { "compact" }?
Heading.attrib &= align.attrib
hr.attlist &=
attribute align { "left" | "center" | "right" }?,
attribute noshade { "noshade" }?,
attribute size { Pixels.datatype }?,
attribute width { Pixels.datatype }?
img.attlist &=
attribute align { "top" | "middle" | "bottom" | "left" | "right" }?,
attribute border { Pixels.datatype }?,
attribute hspace { Pixels.datatype }?,
attribute vspace { Pixels.datatype }?
input.attlist &= align.attrib
legend.attlist &=
attribute align { "top" | "bottom" | "left" | "right" }?
li.attlist &=
attribute type { text }?,
attribute value { text }?
object.attlist &=
attribute align { "top" | "middle" | "bottom" | "left" | "right" }?,
attribute border { Pixels.datatype }?,
attribute hspace { Pixels.datatype }?,
attribute vspace { Pixels.datatype }?
ol.attlist &=
attribute type { text }?,
attribute compact { "compact" }?,
attribute start { text }?
p.attlist &= align.attrib
pre.attlist &= attribute width { Length.datatype }?
script.attlist &= attribute language { ContentType.datatype }?
table.attlist &=
align.attrib,
attribute bgcolor { Color.datatype }?
tr.attlist &= attribute bgcolor { Color.datatype }?
Cell.attrib &=
attribute nowrap { "nowrap" }?,
attribute bgcolor { Color.datatype }?,
attribute width { Pixels.datatype }?,
attribute height { Pixels.datatype }?
ul.attlist &=
attribute type { text }?,
attribute compact { "compact" }?
align.attrib = attribute align { "left" | "all" | "right" | "none" }?
Color.datatype = text
Inline.class |= font | basefont | s | strike | u
Block.class |= center | isindex
List.class |= dir | menu
head.content &= isindex?
Block.mix |= text | Inline.class
# With the legacy module and the frames modules, the html
# element can contain either body or frameset.
frameset |= body

View file

@ -0,0 +1,13 @@
# Link Module
link = element link { link.attlist }
link.attlist =
Common.attrib,
attribute charset { Charset.datatype }?,
attribute href { URI.datatype }?,
attribute hreflang { LanguageCode.datatype }?,
attribute type { ContentType.datatype }?,
attribute rel { LinkTypes.datatype }?,
attribute rev { LinkTypes.datatype }?,
attribute media { MediaDesc.datatype }?
head.content &= link*

View file

@ -0,0 +1,16 @@
# List Module
dl = element dl { dl.attlist, (dt | dd)+ }
dl.attlist = Common.attrib
dt = element dt { dt.attlist, Inline.model }
dt.attlist = Common.attrib
dd = element dd { dd.attlist, Flow.model }
dd.attlist = Common.attrib
ol = element ol { ol.attlist, li+ }
ol.attlist = Common.attrib
ul = element ul { ul.attlist, li+ }
ul.attlist = Common.attrib
li = element li { li.attlist, Flow.model }
li.attlist = Common.attrib
List.class = ul | ol | dl
Block.class |= List.class

View file

@ -0,0 +1,10 @@
# Meta Module
meta = element meta { meta.attlist }
meta.attlist =
I18n.attrib,
attribute http-equiv { NMTOKEN.datatype }?,
attribute name { NMTOKEN.datatype }?,
attribute content { text }?,
attribute scheme { text }?
head.content &= meta*

View file

@ -0,0 +1,10 @@
# Name Identification Module
a.attlist &= name.attlist
applet.attlist &= name.attlist
form.attlist &= name.attlist
frame.attrib &= name.attlist
iframe.attlist &= name.attlist
img.attlist &= name.attlist
map.attlist &= name.attlist
name.attlist = attribute name { text }?

View file

@ -0,0 +1,24 @@
# Object Module
object =
element object {
object.attlist,
# No restrictions on mixed content in TREX.
param*,
Flow.model
}
object.attlist =
Common.attrib,
attribute declare { "declare" }?,
attribute classid { URI.datatype }?,
attribute codebase { URI.datatype }?,
attribute data { URI.datatype }?,
attribute type { ContentType.datatype }?,
attribute codetype { ContentType.datatype }?,
attribute archive { URIs.datatype }?,
attribute standby { Text.datatype }?,
attribute height { Length.datatype }?,
attribute width { Length.datatype }?,
attribute name { text }?,
attribute tabindex { Number.datatype }?
Inline.class |= object

View file

@ -0,0 +1,9 @@
# Param Module
param = element param { param.attlist }
param.attlist =
id.attrib,
attribute name { text },
attribute value { text }?,
attribute valuetype { "data" | "ref" | "object" }?,
attribute type { ContentType.datatype }?

View file

@ -0,0 +1,18 @@
hr = element hr { hr.attlist }
hr.attlist = Common.attrib
Block.class |= hr
b = element b { b.attlist, Inline.model }
b.attlist = Common.attrib
big = element big { big.attlist, Inline.model }
big.attlist = Common.attrib
i = element i { i.attlist, Inline.model }
i.attlist = Common.attrib
small = element small { small.attlist, Inline.model }
small.attlist = Common.attrib
sub = element sub { sub.attlist, Inline.model }
sub.attlist = Common.attrib
sup = element sup { sup.attlist, Inline.model }
sup.attlist = Common.attrib
tt = element tt { tt.attlist, Inline.model }
tt.attlist = Common.attrib
Inline.class |= b | big | i | small | sub | sup | tt

View file

@ -0,0 +1,21 @@
ruby =
element ruby {
ruby.attlist,
((rb,
(rt | (rp, rt, rp)))
| (rbc, rtc, rtc?))
}
ruby.attlist = Common.attrib
rbc = element rbc { rbc.attlist, rb+ }
rbc.attlist = Common.attrib
rtc = element rtc { rtc.attlist, rt+ }
rtc.attlist = Common.attrib
rb = element rb { rb.attlist, Inline.model }
rb.attlist = Common.attrib
rt = element rt { rt.attlist, Inline.model }
rt.attlist =
Common.attrib,
attribute rt { Number.datatype }?
rp = element rp { rp.attlist, text }
rp.attlist = Common.attrib
Inline.class |= ruby

View file

@ -0,0 +1,15 @@
# Script Module
script = element script { script.attlist, text }
script.attlist =
attribute charset { Charset.datatype }?,
attribute type { ContentType.datatype },
attribute src { URI.datatype }?,
attribute defer { "defer" }?,
attribute xml:space { "preserve" }?
noscript = element noscript { noscript.attlist, Block.model }
noscript.attlist = Common.attrib
head.content &= script*
Script.class = noscript | script
Inline.class |= Script.class
Block.class |= Script.class

View file

@ -0,0 +1,5 @@
# Server-side Image Map Module
# Depends on image module.
img.attlist &= attribute ismap { "ismap" }?

View file

@ -0,0 +1,14 @@
# Structure Module
start = html
title = element title { title.attlist, text }
title.attlist = I18n.attrib
head = element head { head.attlist, head.content }
head.attlist = I18n.attrib, profile.attlist
head.content = title
profile.attlist = attribute profile { URI.datatype }?
body = element body { body.attlist, Block.model }
body.attlist = Common.attrib
html = element html { html.attlist, head, body }
html.attlist = XHTML.version.attrib, I18n.attrib
XHTML.version.attrib = attribute version { FPI.datatype }?

View file

@ -0,0 +1,10 @@
# Style Module
style = element style { style.attlist, text }
style.attlist =
title.attrib,
I18n.attrib,
attribute type { ContentType.datatype },
attribute media { MediaDesc.datatype }?,
attribute xml:space { "preserve" }?
head.content &= style*

View file

@ -0,0 +1,67 @@
# Tables Module
# This builds on the basic tables module, unlike with the DTD
# implementation.
include "xhtml-basic-table.rnc" {
table =
element table {
table.attlist,
caption?,
(col* | colgroup*),
((thead?, tfoot?, tbody+) | tr+)
}
th = element th { th.attlist, Flow.model }
td = element td { td.attlist, Flow.model }
CellHAlign.attrib =
attribute align {
"left" | "center" | "right" | "justify" | "char"
}?,
attribute char { Character.datatype }?,
attribute charoff { Length.datatype }?
CellVAlign.attrib =
attribute valign { "top" | "middle" | "bottom" | "baseline" }?
scope.attrib =
attribute scope { "row" | "col" | "rowgroup" | "colgroup" }?
}
table.attlist &=
attribute width { Length.datatype }?,
attribute border { Pixels.datatype }?,
frame.attrib,
rules.attrib,
attribute cellspacing { Length.datatype }?,
attribute cellpadding { Length.datatype }?
col = element col { col.attlist }
col.attlist =
Common.attrib,
attribute span { Number.datatype }?,
attribute width { MultiLength.datatype }?,
CellHAlign.attrib,
CellVAlign.attrib
colgroup = element colgroup { colgroup.attlist, col* }
colgroup.attlist =
Common.attrib,
attribute span { Number.datatype }?,
attribute width { MultiLength.datatype }?,
CellHAlign.attrib,
CellVAlign.attrib
tbody = element tbody { tbody.attlist, tr+ }
tbody.attlist = Common.attrib, CellHAlign.attrib, CellVAlign.attrib
thead = element thead { thead.attlist, tr+ }
thead.attlist = Common.attrib, CellHAlign.attrib, CellVAlign.attrib
tfoot = element tfoot { tfoot.attlist, tr+ }
tfoot.attlist = Common.attrib, CellHAlign.attrib, CellVAlign.attrib
frame.attrib =
attribute frame {
"void"
| "above"
| "below"
| "hsides"
| "lhs"
| "rhs"
| "vsides"
| "box"
| "border"
}?
rules.attrib =
attribute rules { "none" | "groups" | "rows" | "cols" | "all" }?

View file

@ -0,0 +1,8 @@
# Target Module
a.attlist &= target.attrib
area.attlist &= target.attrib
base.attlist &= target.attrib
link.attrib &= target.attrib
form.attlist &= target.attrib
target.attrib = attribute target { text }?

View file

@ -0,0 +1,73 @@
# Text Module
br = element br { br.attlist, empty }
br.attlist = Core.attrib
span = element span { span.attlist, Inline.model }
span.attlist = Common.attrib
abbr = element abbr { abbr.attlist, Inline.model }
abbr.attlist = Common.attrib
acronym = element acronym { acronym.attlist, Inline.model }
acronym.attlist = Common.attrib
cite = element cite { cite.attlist, Inline.model }
cite.attlist = Common.attrib
code = element code { code.attlist, Inline.model }
code.attlist = Common.attrib
dfn = element dfn { dfn.attlist, Inline.model }
dfn.attlist = Common.attrib
em = element em { em.attlist, Inline.model }
em.attlist = Common.attrib
kbd = element kbd { kbd.attlist, Inline.model }
kbd.attlist = Common.attrib
q = element q { q.attlist, Inline.model }
q.attlist =
Common.attrib,
attribute cite { URI.datatype }?
samp = element samp { samp.attlist, Inline.model }
samp.attlist = Common.attrib
strong = element strong { strong.attlist, Inline.model }
strong.attlist = Common.attrib
var = element var { var.attlist, Inline.model }
var.attlist = Common.attrib
\div = element div { div.attlist, Flow.model }
div.attlist = Common.attrib
p = element p { p.attlist, Inline.model }
p.attlist = Common.attrib
address = element address { address.attlist, Inline.model }
address.attlist = Common.attrib
blockquote = element blockquote { blockquote.attlist, Block.model }
blockquote.attlist =
Common.attrib,
attribute cite { URI.datatype }?
pre = element pre { pre.attlist, Inline.model }
pre.attlist =
Common.attrib,
attribute xml:space { "preserve" }?
h1 = element h1 { Heading.attrib, Heading.content }
h2 = element h2 { Heading.attrib, Heading.content }
h3 = element h3 { Heading.attrib, Heading.content }
h4 = element h4 { Heading.attrib, Heading.content }
h5 = element h5 { Heading.attrib, Heading.content }
h6 = element h6 { Heading.attrib, Heading.content }
Heading.attrib = Common.attrib
Heading.content = Inline.model
Heading.class = h1 | h2 | h3 | h4 | h5 | h6
Block.class = address | blockquote | \div | p | pre | Heading.class
Inline.class =
abbr
| acronym
| br
| cite
| code
| dfn
| em
| kbd
| q
| samp
| span
| strong
| var
Inline.model = (text | Inline.class)*
# This is redefined by the legacy module to include inlines.
Block.mix = Block.class
Block.model = Block.mix+
Flow.model = (text | Inline.class | Block.class)*

View file

@ -0,0 +1,37 @@
# XHTML
# This corresponds to the union of transitional and frameset.
default namespace = "http://www.w3.org/1999/xhtml"
include "xhtml-datatypes.rnc"
include "xhtml-attribs.rnc"
# include "xhtml-struct.rnc"
include "xhtml-frames.rnc"
include "xhtml-text.rnc"
include "xhtml-hypertext.rnc"
include "xhtml-list.rnc"
include "xhtml-image.rnc"
include "xhtml-ssismap.rnc"
include "xhtml-base.rnc"
include "xhtml-link.rnc"
include "xhtml-meta.rnc"
include "xhtml-param.rnc"
include "xhtml-object.rnc"
include "xhtml-bdo.rnc"
include "xhtml-pres.rnc"
include "xhtml-edit.rnc"
include "xhtml-applet.rnc"
# include "xhtml-basic-form.rnc"
include "xhtml-form.rnc"
include "xhtml-style.rnc"
include "xhtml-script.rnc"
# include "xhtml-basic-table.rnc"
include "xhtml-table.rnc"
include "xhtml-csismap.rnc"
include "xhtml-events.rnc"
include "xhtml-inlstyle.rnc"
include "xhtml-target.rnc"
include "xhtml-iframe.rnc"
include "xhtml-nameident.rnc"
include "xhtml-legacy.rnc"

View file

@ -0,0 +1,356 @@
# $Id: xslt.rnc,v 1.2 2003/08/30 08:09:03 jjc Exp $
# This was mostly generated from the syntax summary in the XSLT
# Recommendation (using XSLT of course).
# Issues: this validates extension elements as literal result
# elements, which is overly restrictive.
namespace local = ""
default namespace xsl = "http://www.w3.org/1999/XSL/Transform"
start =
stylesheet.element
| transform.element
| literal-result-element-as-stylesheet
version = "1.0"
top-level-elements.model =
(top-level-element.category | top-level-extension)*
top-level-extension =
element * - (xsl:* | local:*) {
grammar {
start = any
any =
(attribute * { text }
| text
| element * { any })*
}
}
template.model = (instruction.category | literal-result-element | text)*
literal-result-element-as-stylesheet =
element * - xsl:* {
attribute xsl:version { version },
literal-result-element-no-version.atts,
template.model
}
literal-result-element =
element * - xsl:* { literal-result-element.atts, template.model }
literal-result-element.atts =
literal-result-element-no-version.atts,
attribute xsl:version { version }?
literal-result-element-no-version.atts =
(attribute * - xsl:* { avt.datatype }
| attribute xsl:extension-element-prefixes { prefixes.datatype }
| attribute xsl:exclude-result-prefixes { prefixes.datatype }
| attribute xsl:use-attribute-sets { qnames.datatype })*
top-level-element.category =
include.element
| strip-space.element
| preserve-space.element
| template.element
| namespace-alias.element
| attribute-set.element
| variable.element
| param.element
| key.element
| decimal-format.element
| output.element
instruction.category =
apply-templates.element
| apply-imports.element
| call-template.element
| element.element
| attribute.element
| text.element
| processing-instruction.element
| comment.element
| copy.element
| value-of.element
| number.element
| for-each.element
| if.element
| choose.element
| variable.element
| copy-of.element
| message.element
| fallback.element
extension.atts = attribute * - (xsl:* | local:*) { text }*
stylesheet.element = element stylesheet { stylesheet.model }
transform.element = element transform { stylesheet.model }
stylesheet.model =
extension.atts,
attribute id { xsd:NCName }?,
attribute extension-element-prefixes { prefixes.datatype }?,
attribute exclude-result-prefixes { prefixes.datatype }?,
attribute version { version },
(import.element*, top-level-elements.model)
include.element =
element include {
extension.atts,
attribute href { xsd:anyURI }
}
import.element =
element import {
extension.atts,
attribute href { xsd:anyURI }
}
strip-space.element =
element strip-space {
extension.atts,
attribute elements { wildcards.datatype }
}
preserve-space.element =
element preserve-space {
extension.atts,
attribute elements { wildcards.datatype }
}
template.element =
element template {
extension.atts,
attribute match { pattern.datatype }?,
attribute name { qname.datatype }?,
attribute priority { number.datatype }?,
attribute mode { qname.datatype }?,
(param.element*, template.model)
}
apply-templates.element =
element apply-templates {
extension.atts,
attribute select { expression.datatype }?,
attribute mode { qname.datatype }?,
(sort.element | with-param.element)*
}
apply-imports.element = element apply-imports { extension.atts }
call-template.element =
element call-template {
extension.atts,
attribute name { qname.datatype },
with-param.element*
}
namespace-alias.element =
element namespace-alias {
extension.atts,
attribute stylesheet-prefix { prefix.datatype },
attribute result-prefix { prefix.datatype }
}
element.element =
element element {
extension.atts,
attribute name { qname.datatype | expr-avt.datatype },
attribute namespace { xsd:anyURI | brace-avt.datatype }?,
attribute use-attribute-sets { qnames.datatype }?,
template.model
}
attribute.element =
element attribute {
extension.atts,
attribute name { qname.datatype | expr-avt.datatype },
attribute namespace { xsd:anyURI | brace-avt.datatype }?,
template.model
}
attribute-set.element =
element attribute-set {
extension.atts,
attribute name { qname.datatype },
attribute use-attribute-sets { qnames.datatype }?,
attribute.element*
}
text.element =
element text {
extension.atts,
attribute disable-output-escaping {
xsd:string "yes" | xsd:string "no"
}?,
text
}
processing-instruction.element =
element processing-instruction {
extension.atts,
attribute name { xsd:NCName | expr-avt.datatype },
template.model
}
comment.element = element comment { extension.atts, template.model }
copy.element =
element copy {
extension.atts,
attribute use-attribute-sets { qnames.datatype }?,
template.model
}
value-of.element =
element value-of {
extension.atts,
attribute select { expression.datatype },
attribute disable-output-escaping {
xsd:string "yes" | xsd:string "no"
}?
}
number.element =
element number {
extension.atts,
attribute level {
xsd:string "single" | xsd:string "multiple" | xsd:string "any"
}?,
attribute count { pattern.datatype }?,
attribute from { pattern.datatype }?,
attribute value { expression.datatype }?,
attribute format { avt.datatype }?,
attribute lang { xsd:NMTOKEN | expr-avt.datatype }?,
attribute letter-value {
xsd:string "alphabetic"
| xsd:string "traditional"
| expr-avt.datatype
}?,
attribute grouping-separator { char.datatype | expr-avt.datatype }?,
attribute grouping-size { number.datatype | expr-avt.datatype }?
}
for-each.element =
element for-each {
extension.atts,
attribute select { expression.datatype },
(sort.element*, template.model)
}
if.element =
element if {
extension.atts,
attribute test { expression.datatype },
template.model
}
choose.element =
element choose { extension.atts, (when.element+, otherwise.element?) }
when.element =
element when {
extension.atts,
attribute test { expression.datatype },
template.model
}
otherwise.element = element otherwise { extension.atts, template.model }
sort.element =
element sort {
extension.atts,
attribute select { expression.datatype }?,
attribute lang { xsd:NMTOKEN | expr-avt.datatype }?,
attribute data-type {
xsd:string "text"
| xsd:string "number"
| qname-but-not-ncname.datatype
| expr-avt.datatype
}?,
attribute order {
xsd:string "ascending"
| xsd:string "descending"
| expr-avt.datatype
}?,
attribute case-order {
xsd:string "upper-first"
| xsd:string "lower-first"
| expr-avt.datatype
}?
}
variable.element =
element variable {
extension.atts,
attribute name { qname.datatype },
(attribute select { expression.datatype }
| template.model)
}
param.element =
element param {
extension.atts,
attribute name { qname.datatype },
(attribute select { expression.datatype }
| template.model)
}
copy-of.element =
element copy-of {
extension.atts,
attribute select { expression.datatype }
}
with-param.element =
element with-param {
extension.atts,
attribute name { qname.datatype },
(attribute select { expression.datatype }
| template.model)
}
key.element =
element key {
extension.atts,
attribute name { qname.datatype },
attribute match { pattern.datatype },
attribute use { expression.datatype }
}
decimal-format.element =
element decimal-format {
extension.atts,
attribute name { qname.datatype }?,
attribute decimal-separator { char.datatype }?,
attribute grouping-separator { char.datatype }?,
attribute infinity { text }?,
attribute minus-sign { char.datatype }?,
attribute NaN { text }?,
attribute percent { char.datatype }?,
attribute per-mille { char.datatype }?,
attribute zero-digit { char.datatype }?,
attribute digit { char.datatype }?,
attribute pattern-separator { char.datatype }?
}
message.element =
element message {
extension.atts,
attribute terminate { xsd:string "yes" | xsd:string "no" }?,
template.model
}
fallback.element = element fallback { extension.atts, template.model }
output.element =
element output {
extension.atts,
attribute method {
xsd:string "xml"
| xsd:string "html"
| xsd:string "text"
| qname-but-not-ncname.datatype
}?,
attribute version { xsd:NMTOKEN }?,
attribute encoding { text }?,
attribute omit-xml-declaration {
xsd:string "yes" | xsd:string "no"
}?,
attribute standalone { xsd:string "yes" | xsd:string "no" }?,
attribute doctype-public { text }?,
attribute doctype-system { text }?,
attribute cdata-section-elements { qnames.datatype }?,
attribute indent { xsd:string "yes" | xsd:string "no" }?,
attribute media-type { text }?
}
prefixes.datatype = list { (xsd:NCName | "#default")* }
prefix.datatype = xsd:NCName | "#default"
wildcards.datatype =
list {
(xsd:QName
| xsd:token { pattern = "\*|\i\c*:\*" })*
}
qname.datatype = xsd:QName
qnames.datatype = list { xsd:QName* }
char.datatype = xsd:string { length = "1" }
number.datatype = xsd:decimal
expression.datatype = text
pattern.datatype = text
qname-but-not-ncname.datatype = xsd:QName { pattern = ".*:.*" }
# An AVT containing at least one expression.
expr-avt.datatype =
xsd:string {
pattern =
"""([^\{\}]|\{\{|\}\})*\{([^"'\{\}]|"[^"]*"|'[^']*')+\}([^\{\}]|\{\{|\}\}|\{([^"'\{\}]|"[^"]*"|'[^']*')+\})*"""
}
# An AVT containing at least one brace; ie where instantiated AVT
# is not the same as the literal AVT.
brace-avt.datatype =
xsd:string {
pattern =
"""[^\{\}]*(\{\{|\}\}|\{([^"'\{\}]|"[^"]*"|'[^']*')+\})([^\{\}]|\{\{|\}\}|\{([^"'\{\}]|"[^"]*"|'[^']*')+\})*"""
}
avt.datatype =
xsd:string {
pattern =
"""([^\{\}]|\{\{|\}\}|\{([^"'\{\}]|"[^"]*"|'[^']*')+\})*"""
}