All Downloads are FREE. Search and download functionalities are using the official Maven repository.

relaxng.tables.rnc Maven / Gradle / Ivy

The newest version!
datatypes w = "http://whattf.org/datatype-draft"

# #####################################################################
##  RELAX NG Schema for HTML 5: Tables                                #
# #####################################################################

# #####################################################################
## Table Envelope

## Table Datatypes

#	tables.data.multilen =
#		(	common.data.integer.positive
#		|	common.data.percent
#		|	xsd:token { pattern = "[0-9]+\*" } #REVISIT should this one be string? 
#		)

## Table Alignment Attributes

	tables.attrs.alignment =
		(	tables.attrs.align?
		&	tables.attrs.char?
		&	tables.attrs.valign?
		)
		tables.attrs.align =
			attribute align {
				(	w:string "left" 
				|	w:string "center"
				|	w:string "right"
				|	w:string "justify"
				|	w:string "char"
				)
			}
		tables.attrs.char =
			attribute char {
				xsd:string { pattern = "." }
			}
		tables.attrs.valign =
			attribute valign {
				(	w:string "top"
				|	w:string "middle"
				|	w:string "bottom"
				|	w:string "baseline"
				)
			}

## Data Table: 

	table.elem =
		element table { table.inner & table.attrs }
	table.attrs =
		(	common.attrs
		&	common.attrs.aria?
		)
	table.inner =
		(	caption.elem?
		,	common.elem.script-supporting*
		,	colgroup.elem*
		,	common.elem.script-supporting*
		,	thead.elem?
		,	common.elem.script-supporting*
		,	(	(	tfoot.elem
				,	common.elem.script-supporting*
				,	( tbody.elem* | tr.elem+ )
				,	common.elem.script-supporting*
				)
			|	(	( tbody.elem* | tr.elem+ )
				,	common.elem.script-supporting*
				,	tfoot.elem?
				)
			)
		) 

	common.elem.flow |= table.elem

## Table Caption: colgroup.elem =
		element colgroup { colgroup.inner & colgroup.attrs }
	colgroup.attrs =
		(	common.attrs
		&	(	common.attrs.aria.role.presentation
			|	common.attrs.aria.role.menuitem
			)?
		)
		colgroup.attrs.span =
			attribute span {
				common.data.integer.positive
			}
	colgroup.inner =
		(	(	col.elem*
			&	common.elem.script-supporting*
			)
			|	colgroup.attrs.span?
		)

## Table Column: col.elem =
		element col { col.inner & col.attrs }
	col.attrs =
		(	common.attrs
		&	col.attrs.span?
		&	(	common.attrs.aria.role.presentation
			|	common.attrs.aria.role.menuitem
			)?
		)
		col.attrs.span =
			attribute span {
				common.data.integer.positive
			}
	col.inner =
		( empty )

## Table Header Row Group

	thead.elem =
		element thead { thead.inner & thead.attrs }
	thead.attrs =
		(	common.attrs
		&	(	common.attrs.aria.role.presentation
			|	common.attrs.aria.role.menuitem
			)?
		)
	thead.inner =
		(	tr.elem*
		&	common.elem.script-supporting*
		)

## Table Footer Row Group

	tfoot.elem =
		element tfoot { tfoot.inner & tfoot.attrs }
	tfoot.attrs =
		(	common.attrs
		&	(	common.attrs.aria.role.presentation
			|	common.attrs.aria.role.menuitem
			)?
		)
	tfoot.inner =
		(	tr.elem*
		&	common.elem.script-supporting*
		)

## Table Row Group

	tbody.elem =
		element tbody { tbody.inner & tbody.attrs }
	tbody.attrs =
		(	common.attrs
		&	(	common.attrs.aria.role.presentation
			|	common.attrs.aria.role.menuitem
			)?
		)
	tbody.inner =
		(	tr.elem*
		&	common.elem.script-supporting*
		)

# #####################################################################
## Cell Structure

## Table Row

	tr.elem =
		element tr { tr.inner & tr.attrs }
	tr.attrs =
		(	common.attrs
		&	common.attrs.aria?
		)
	tr.inner =
		( ( td.elem | th.elem | common.elem.script-supporting )* )

## Common Table Cell Attributes

	tables.attrs.cell-structure =
		(	tables.attrs.colspan?
		&	tables.attrs.rowspan?
		)
		tables.attrs.colspan =
			attribute colspan {
				common.data.integer.positive
			}
		tables.attrs.rowspan =
			attribute rowspan {
				common.data.integer.non-negative
			}

	tables.attrs.access-headers =
		( tables.attrs.headers? )
		tables.attrs.headers =
			attribute headers {
				common.data.idrefs
			}

	tables.attrs.define-headers =
		( tables.attrs.scope? )
		tables.attrs.scope =
			attribute scope {
				(	w:string "row"
				|	w:string "col"
				|	w:string "rowgroup"
				|	w:string "colgroup"
				)
			}
		tables.attrs.abbr =
			attribute abbr {
				text
			}

## Table Data Cell: 
caption.elem = element caption { caption.inner & caption.attrs } caption.attrs = ( common.attrs & ( common.attrs.aria.role.presentation | common.attrs.aria.role.menuitem )? ) caption.inner = ( common.inner.flow ) # ##################################################################### ## Table Super Structure ## Table Column Group:
td.elem = element td { td.inner & td.attrs } td.attrs = ( common.attrs & tables.attrs.cell-structure & tables.attrs.headers? # & tables.attrs.alignment & common.attrs.aria? ) td.inner = ( common.inner.flow ) ## Table Header Cells: th.elem = element th { th.inner & th.attrs } th.attrs = ( common.attrs & tables.attrs.cell-structure & tables.attrs.scope? & tables.attrs.headers? # & tables.attrs.alignment & common.attrs.aria? ) th.inner = ( common.inner.flow )