default namespace = "http://www.xmlmind.com/ns/sect"
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"

start = section-element

section-element = element section {
    common-attributes,
    title-element,
    (block-elements+ | 
     (block-elements*, section-element+))
}

common-attributes = lang-attribute?

lang-attribute = attribute xml:lang { xsd:language }

title-element = element title { 
    common-attributes,
    inline-content 
}

inline-content = (text | bold-element | italic-element | literal-element |
                  break-element | image-element)*

block-elements = (paragraph-element | table-element)

paragraph-element = element paragraph { 
    common-attributes,
    inline-content 
}

bold-element = element bold { 
    common-attributes,
    inline-content 
}

italic-element = element italic {
    common-attributes,
    inline-content 
}

literal-element = element literal {
    common-attributes,
    inline-content 
}

break-element = element break {
    common-attributes
}

image-element = element image { 
    common-attributes,
    attribute source { xsd:anyURI },
    attribute width { xsd:positiveInteger }?,
    attribute height { xsd:positiveInteger }?
}

table-element = element table {
    common-attributes,
    tableHeader-element?,
    tableRow-element+
}

tableHeader-element = element tableHeader {
    common-attributes,
    tableCell-element+
}

tableRow-element = element tableRow {
    common-attributes,
    tableCell-element+
}

tableCell-element = element tableCell {
    common-attributes,
    [ a:defaultValue = "1" ] attribute columns { xsd:positiveInteger }?,
    block-elements+
}

