Skip to content

Instantly share code, notes, and snippets.

@takahashim
Created June 9, 2010 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takahashim/431062 to your computer and use it in GitHub Desktop.
Save takahashim/431062 to your computer and use it in GitHub Desktop.
default namespace="http://tc100.iec.ch/2005/ebook/generic"
start = ebook-g
ebook-g = ebook-g-core
| external "bbebxylog.rnc"
ebook-g-core = meta-g & body-g
meta-g = external "meta-g.rnc"
body-g = element body-g { body }
body =
title*,
foreword*,
introduction*,
titled-clause+,
annex*,
bibliography*
title = element title {
element main { text },
element sub { text }?
}
foreword = element foreword { text }
introduction = element introduction { block+ }
titled-clause = element clause { id, title, clause-content }
clause-content =
(titled-clause, titled-clause+) | untitled-clause-content
untitled-clause-content = (untitled-clause, untitled-clause+) | block+
untitled-clause = element clause { id, untitled-clause-content }
referenced-document =
element referenced-document {
id,
element abbrev { text },
element title { text },
element field { text }*,
element url { xsd:anyURI }
}
annex =
element annex {
id,
title,
clause-content
}
bibliography = element bibliography { referenced-document+ }
block = p | ol | ul | example | note | pre | float
p = element p { inline }
float = table | figure
table = external "table.rnc"
figure = external "figure.rnc"
ol =
element ol {
element li { id, block+ }+
}
ul =
element ul {
element li { block+ }+
}
example = element example { p+ }
note = element note { p+ }
pre = element pre { pre-content }
pre-content =
(text
| element var { pre-content })*
inline =
(text
| element code | b | i | var { inline }
| ref
| strong)*
ref =
element ref {
attribute to { xsd:IDREF }
}
id = attribute id { xsd:ID }?
strong = element strong { text }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment