relaxng.phrase.rnc Maven / Gradle / Ivy
The newest version!
datatypes w = "http://whattf.org/datatype-draft"
# #####################################################################
## RELAX NG Schema for HTML 5: Phrase Markup #
# #####################################################################
## Contextual Hyperlink:
a.elem.phrasing =
element a { a.inner.phrasing & a.attrs }
a.elem.flow =
element a { a.inner.flow & a.attrs }
a.attrs =
( common.attrs.basic
& common.attrs.i18n
& common.attrs.present
& common.attrs.other
& a.attrs.name?
& shared-hyperlink.attrs.download?
& shared-hyperlink.attrs.href?
& shared-hyperlink.attrs.target?
& shared-hyperlink.attrs.rel?
& shared-hyperlink.attrs.hreflang?
& shared-hyperlink.attrs.type?
& shared-hyperlink.attrs.ping?
& ( common.attrs.aria.implicit.link
| common.attrs.aria.role.button
| common.attrs.aria.role.checkbox
| common.attrs.aria.role.link
| common.attrs.aria.role.menuitem
| common.attrs.aria.role.menuitemcheckbox
| common.attrs.aria.role.menuitemradio
| common.attrs.aria.role.tab
| common.attrs.aria.role.treeitem
)?
)
a.attrs.name =
attribute name {
common.data.id # XXX not what the spec says
}
a.inner.phrasing =
( common.inner.phrasing )
a.inner.flow =
( common.inner.transparent.flow )
common.elem.phrasing |= a.elem.phrasing
common.elem.flow |= a.elem.flow
## Shared hyperlink attributes
shared-hyperlink.attrs.download =
attribute download {
string
}
shared-hyperlink.attrs.href =
attribute href {
common.data.uri
}
shared-hyperlink.attrs.target =
attribute target {
common.data.browsing-context-or-keyword
}
shared-hyperlink.attrs.rel =
attribute rel {
w:a-rel
}
shared-hyperlink.attrs.hreflang =
attribute hreflang {
common.data.langcode
}
shared-hyperlink.attrs.media =
attribute media {
common.data.mediaquery
}
shared-hyperlink.attrs.type =
attribute type {
common.data.mimetype
}
shared-hyperlink.attrs.ping =
attribute ping {
common.data.uris
} & v5only & nonW3C
## Emphatic Stress:
em.elem =
element em { em.inner & em.attrs }
em.attrs =
( common.attrs
& common.attrs.aria?
)
em.inner =
( common.inner.phrasing )
common.elem.phrasing |= em.elem
## Strong Importance:
strong.elem =
element strong { strong.inner & strong.attrs }
strong.attrs =
( common.attrs
& common.attrs.aria?
)
strong.inner =
( common.inner.phrasing )
common.elem.phrasing |= strong.elem
## Small Print and Side Comments:
small.elem =
element small { small.inner & small.attrs }
small.attrs =
( common.attrs
& common.attrs.aria?
)
small.inner =
( common.inner.phrasing )
common.elem.phrasing |= small.elem
## Marked (Highlighted) Text:
mark.elem =
element mark { mark.inner & mark.attrs }
& v5only
mark.attrs =
( common.attrs
& ( common.attrs.aria.role.presentation
| common.attrs.aria.role.menuitem
)?
)
mark.inner =
( common.inner.phrasing )
common.elem.phrasing |= mark.elem
## Abbreviation:
abbr.elem =
element abbr { abbr.inner & abbr.attrs }
abbr.attrs =
( common.attrs
# abbr.attrs.title included in common.attrs
& common.attrs.aria?
)
abbr.inner =
( common.inner.phrasing )
common.elem.phrasing |= abbr.elem
## Defining Instance:
dfn.elem =
element dfn { dfn.inner & dfn.attrs }
dfn.attrs =
( common.attrs
# dfn.attrs.title included in common.attrs
& common.attrs.aria?
)
dfn.inner =
( common.inner.phrasing )
common.elem.phrasing |= dfn.elem
## Italic:
i.elem =
element i { i.inner & i.attrs }
i.attrs =
( common.attrs
& common.attrs.aria?
)
i.inner =
( common.inner.phrasing )
common.elem.phrasing |= i.elem
## Bold:
b.elem =
element b { b.inner & b.attrs }
b.attrs =
( common.attrs
& common.attrs.aria?
)
b.inner =
( common.inner.phrasing )
common.elem.phrasing |= b.elem
## Struck Text:
s.elem =
element s { s.inner & s.attrs }
s.attrs =
( common.attrs
& common.attrs.aria?
)
s.inner =
( common.inner.phrasing )
common.elem.phrasing |= s.elem
## Underline:
u.elem =
element u { u.inner & u.attrs }
u.attrs =
( common.attrs
& common.attrs.aria?
)
u.inner =
( common.inner.phrasing )
common.elem.phrasing |= u.elem
## Code Fragment:
code.elem =
element code { code.inner & code.attrs }
code.attrs =
( common.attrs
& common.attrs.aria?
)
code.inner =
( common.inner.phrasing )
common.elem.phrasing |= code.elem
## Variable or Placeholder:
var.elem =
element var { var.inner & var.attrs }
var.attrs =
( common.attrs
& common.attrs.aria?
)
var.inner =
( common.inner.phrasing )
common.elem.phrasing |= var.elem
## (Sample) Output:
samp.elem =
element samp { samp.inner & samp.attrs }
samp.attrs =
( common.attrs
& common.attrs.aria?
)
samp.inner =
( common.inner.phrasing )
common.elem.phrasing |= samp.elem
## User Input:
kbd.elem =
element kbd { kbd.inner & kbd.attrs }
kbd.attrs =
( common.attrs
& common.attrs.aria?
)
kbd.inner =
( common.inner.phrasing )
common.elem.phrasing |= kbd.elem
## Superscript:
sup.elem =
element sup { sup.inner & sup.attrs }
sup.attrs =
( common.attrs
& common.attrs.aria?
)
sup.inner =
( common.inner.phrasing )
common.elem.phrasing |= sup.elem
## Subscript:
sub.elem =
element sub { sub.inner & sub.attrs }
sub.attrs =
( common.attrs
& common.attrs.aria?
)
sub.inner =
( common.inner.phrasing )
common.elem.phrasing |= sub.elem
## Quotation:
q.elem =
element q { q.inner & q.attrs }
q.attrs =
( common.attrs
& q.attrs.cite?
& common.attrs.aria?
)
q.attrs.cite =
attribute cite {
common.data.uri
}
q.inner =
( common.inner.phrasing )
common.elem.phrasing |= q.elem
## Title of Work:
cite.elem =
element cite { cite.inner & cite.attrs }
cite.attrs =
( common.attrs
& common.attrs.aria?
)
cite.inner =
( common.inner.phrasing )
common.elem.phrasing |= cite.elem
## Generic Span:
span.elem =
element span { span.inner & span.attrs }
span.attrs =
( common.attrs
& common.attrs.aria?
)
span.inner =
( common.inner.phrasing ) # REVISIT allow ol and ul?
common.elem.phrasing |= span.elem
## Bidirectional Override:
bdo.elem =
element bdo { bdo.inner & bdo.attrs }
bdo.attrs =
( common.attrs # dir required in Schematron
& ( common.attrs.aria.role.presentation
| common.attrs.aria.role.menuitem
)?
)
bdo.inner =
( common.inner.phrasing )
common.elem.phrasing |= bdo.elem
## Bidirectional Isolate:
bdi.elem =
element bdi { bdi.inner & bdi.attrs }
bdi.attrs =
( common.attrs
& ( common.attrs.aria.role.presentation
| common.attrs.aria.role.menuitem
)?
)
bdi.inner =
( common.inner.phrasing )
common.elem.phrasing |= bdi.elem
## Line Break:
br.elem =
element br { br.inner & br.attrs }
br.attrs =
( common.attrs
& ( common.attrs.aria.role.presentation
| common.attrs.aria.role.menuitem
)?
)
br.inner =
( empty )
common.elem.phrasing |= br.elem
## Line-break opportunity:
wbr.elem =
element wbr { wbr.inner & wbr.attrs }
wbr.attrs =
( common.attrs
& ( common.attrs.aria.role.presentation
| common.attrs.aria.role.menuitem
)?
)
wbr.inner =
( empty )
common.elem.phrasing |= wbr.elem