325 lines
5.9 KiB
Plaintext
325 lines
5.9 KiB
Plaintext
datatypes w = "http://whattf.org/datatype-draft"
|
|
|
|
# #####################################################################
|
|
## RELAX NG Schema for HTML 5: Phrase Markup #
|
|
# #####################################################################
|
|
|
|
## Contextual Hyperlink: <a>
|
|
|
|
a.elem.phrasing =
|
|
element a { a.inner.phrasing & a.attrs }
|
|
a.elem.flow =
|
|
element a { a.inner.flow & a.attrs }
|
|
a.attrs =
|
|
( common.attrs
|
|
& a.attrs.name?
|
|
& shared-hyperlink.attrs.href?
|
|
& shared-hyperlink.attrs.target?
|
|
& shared-hyperlink.attrs.rel?
|
|
& shared-hyperlink.attrs.hreflang?
|
|
& shared-hyperlink.attrs.media?
|
|
& shared-hyperlink.attrs.type?
|
|
& shared-hyperlink.attrs.ping?
|
|
& ( common.attrs.aria
|
|
| common.attrs.aria.implicit.link
|
|
)?
|
|
)
|
|
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.flow )
|
|
|
|
common.elem.phrasing |= a.elem.phrasing
|
|
common.elem.flow |= a.elem.flow
|
|
|
|
## Shared hyperlink attributes
|
|
|
|
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 {
|
|
common.data.tokens
|
|
}
|
|
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
|
|
|
|
## Emphatic Stress: <em>
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
mark.elem =
|
|
element mark { mark.inner & mark.attrs }
|
|
& v5only
|
|
mark.attrs =
|
|
( common.attrs )
|
|
mark.inner =
|
|
( common.inner.phrasing )
|
|
|
|
common.elem.phrasing |= mark.elem
|
|
|
|
## Abbreviation: <abbr>
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
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
|
|
|
|
## Code Fragment: <code>
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
sup.elem =
|
|
element sup { sup.inner & sup.attrs }
|
|
sup.attrs =
|
|
( common.attrs )
|
|
sup.inner =
|
|
( common.inner.phrasing )
|
|
|
|
common.elem.phrasing |= sup.elem
|
|
|
|
## Subscript: <sub>
|
|
|
|
sub.elem =
|
|
element sub { sub.inner & sub.attrs }
|
|
sub.attrs =
|
|
( common.attrs )
|
|
sub.inner =
|
|
( common.inner.phrasing )
|
|
|
|
common.elem.phrasing |= sub.elem
|
|
|
|
## Quotation: <q>
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
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>
|
|
|
|
bdo.elem =
|
|
element bdo { bdo.inner & bdo.attrs }
|
|
bdo.attrs =
|
|
( common.attrs ) # dir required in Schematron
|
|
bdo.inner =
|
|
( common.inner.phrasing )
|
|
|
|
common.elem.phrasing |= bdo.elem
|
|
|
|
## Line Break: <br>
|
|
|
|
br.elem =
|
|
element br { br.inner & br.attrs }
|
|
br.attrs =
|
|
( common.attrs )
|
|
br.inner =
|
|
( empty )
|
|
|
|
common.elem.phrasing |= br.elem
|
|
|
|
## Line-break opportunity: <wbr>
|
|
|
|
wbr.elem =
|
|
element wbr { wbr.inner & wbr.attrs }
|
|
wbr.attrs =
|
|
( common.attrs )
|
|
wbr.inner =
|
|
( empty )
|
|
|
|
common.elem.phrasing |= wbr.elem
|