relaxng.meta.rnc Maven / Gradle / Ivy
The newest version!
datatypes w = "http://whattf.org/datatype-draft"
# #####################################################################
## RELAX NG Schema for HTML 5: Global Structure & Metadata #
# #####################################################################
## Root Element:
html.elem =
element html { html.inner & html.attrs }
html.attrs =
( common.attrs
& ( common.attrs.aria.role.presentation
| common.attrs.aria.role.menuitem
)?
)
html.inner =
( head.elem
, body.elem
)
## Metadata Container:
head.elem =
element head { head.inner & head.attrs }
head.attrs =
( common.attrs
# & head.attrs.profile?
& ( common.attrs.aria.role.presentation
| common.attrs.aria.role.menuitem
)?
)
# head.attrs.profile =
# attribute profile {
# common.data.uris #REVISIT should these be absolute (zero or more)
# }
head.inner =
( title.elem
& base.elem? # REVISIT need a non-schema checker or Schematron
& common.inner.metadata # Limit encoding decl position in Schematron
)
# head.inner =
# ( meta.elem.encoding?
# , ( title.elem
# & base.elem? # REVISIT need a non-schema checker or Schematron
# & common.inner.metadata
# )
# )
## Content Container:
body.elem =
element body { body.inner & body.attrs }
body.attrs =
( common.attrs
& ( common.attrs.aria.landmark.application
| common.attrs.aria.landmark.document
| common.attrs.aria.role.presentation
| common.attrs.aria.implicit.document
)?
& body.attrs.onafterprint?
& body.attrs.onbeforeprint?
& body.attrs.onbeforeunload?
& body.attrs.onhashchange?
& body.attrs.onmessage?
& body.attrs.onoffline?
& body.attrs.ononline?
& body.attrs.onpagehide?
& body.attrs.onpageshow?
& body.attrs.onpopstate?
& body.attrs.onresize?
& body.attrs.onstorage?
& body.attrs.onunload?
)
body.inner =
( common.inner.flow )
body.attrs.onafterprint =
attribute onafterprint { common.data.functionbody }
body.attrs.onbeforeprint =
attribute onbeforeprint { common.data.functionbody }
body.attrs.onbeforeunload =
attribute onbeforeunload { common.data.functionbody }
body.attrs.onhashchange =
attribute onhashchange { common.data.functionbody }
body.attrs.onmessage =
attribute onmessage { common.data.functionbody }
body.attrs.onoffline =
attribute onoffline { common.data.functionbody }
body.attrs.ononline =
attribute ononline { common.data.functionbody }
body.attrs.onpopstate =
attribute onpopstate { common.data.functionbody }
body.attrs.onpagehide =
attribute onpagehide { common.data.functionbody }
body.attrs.onpageshow =
attribute onpageshow { common.data.functionbody }
body.attrs.onredo =
attribute onredo { common.data.functionbody }
body.attrs.onresize =
attribute onresize { common.data.functionbody }
body.attrs.onstorage =
attribute onstorage { common.data.functionbody }
body.attrs.onundo =
attribute onundo { common.data.functionbody }
body.attrs.onunload =
attribute onunload { common.data.functionbody }
## Document Title:
title.elem =
element title { title.inner & title.attrs }
title.attrs =
( common.attrs
& ( common.attrs.aria.role.presentation
| common.attrs.aria.role.menuitem
)?
)
title.inner =
( text )
## Base URI:
base.elem =
element base { base.inner & base.attrs }
base.attrs =
( common.attrs.basic
& common.attrs.i18n
& common.attrs.present
& common.attrs.other
& ( ( base.attrs.href
& base.attrs.target?
)
| base.attrs.target
)
& ( common.attrs.aria.role.presentation
| common.attrs.aria.role.menuitem
)?
)
base.attrs.href =
attribute href {
common.data.uri
}
base.attrs.target =
attribute target {
common.data.browsing-context-or-keyword
}
base.inner =
( empty )
## Global Relationships:
link.elem =
element link { link.inner & link.attrs }
link.attrs =
( common.attrs.basic
& common.attrs.i18n
& common.attrs.present
& common.attrs.other
& link.attrs.href
& link.attrs.rel
& shared-hyperlink.attrs.hreflang?
& shared-hyperlink.attrs.media?
& shared-hyperlink.attrs.type?
& link.attrs.sizes?
# link.attrs.title included in common.attrs
& ( common.attrs.aria.role.link
| common.attrs.aria.role.presentation
| common.attrs.aria.role.menuitem
)?
)
link.attrs.href =
attribute href {
common.data.uri.non-empty
}
link.attrs.rel =
attribute rel {
w:link-rel
}
link.attrs.sizes =
attribute sizes {
w:string "any" | common.data.sizes
}
link.inner =
( empty )
common.elem.metadata |= link.elem
## Global Style: