datatypes w = "http://whattf.org/datatype-draft"
namespace local = ""

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

#######################################################################

## Ruby Annotation: <ruby>

	ruby.elem =
		element ruby { ruby.inner & ruby.attrs }
	ruby.attrs =
		(	common.attrs
		&	common.attrs.aria?
		)
	ruby.inner =
		(	(	common.inner.phrasing
			|	rb.elem
			)+
		,	(	rt.elem+
				|	(	rp.elem
					,	(	rt.elem,
							rp.elem
						)+
					)
				|	rtc.elem+
			)
		)+

	common.elem.phrasing |= ruby.elem

## Ruby Text: <rt>

	rt.elem =
		element rt { rt.inner & rt.attrs }
	rt.attrs =
		(	common.attrs
		&	common.attrs.aria?
		)
	rt.inner =
		( common.inner.phrasing )

## Ruby Parenthesis: <rp>

	rp.elem =
		element rp { rp.inner & rp.attrs }
	rp.attrs =
		(	common.attrs
		&	common.attrs.aria?
		)
	rp.inner =
		( text )

## Ruby Base: <rb>

	rb.elem =
		element rb { rb.inner & rb.attrs }
	rb.attrs =
		(	common.attrs
		&	common.attrs.aria?
		)
	rb.inner =
		( common.inner.phrasing )

## Ruby Text Container: <rtc>

	rtc.elem =
		element rtc { rtc.inner & rtc.attrs }
	rtc.attrs =
		(	common.attrs
		&	common.attrs.aria?
		)
	rtc.inner =
		( common.inner.phrasing & rt.elem* )
