operator
isnt
rather than is
reverses the results
content element-qualifier? (is | isnt) (content-type | content-type-list)
Tests an element's declared content type or content model type. It can also be used to determine if an element
has a conref
attribute, in which case the element is effectively EMPTY, no matter what its declared
type is.
The content type can be:
any
-- indicates an element with a content model of ANY.
empty
-- indicates an element with a declared content of EMPTY or an XML empty
element tag ("<foo/>").
declared-empty
-- indicates an element with a declared content of EMPTY.
empty-tag
-- indicates an element with an XML empty element tag ("<foo/>").
cdata
-- indicates an element with a declared content of CDATA.
rcdata
-- indicates an element with a declared content of RCDATA.
element
-- indicates an element with a content model that allows other elements but
does not allow #PCDATA.
mixed
-- indicates an element declared with a content model that allows #PCDATA or a
content model of ANY. (The content model ANY allows #PCDATA.) Elements declared with a content model of ANY
satisfy the tests for both MIXED content models and the ANY content model. So if ANY and MIXED are to be
distinguished, any
should be tested before mixed
. In essence, any
overrides mixed
.
conref
-- indicates an element for which a CONREF attribute has been specified.
A content-type-list is a list of content types separated by or
or "|", or by and
or "&".
If element qualifiers are specified, the test applies to the qualified element. Otherwise, the current element is tested.
The following element
rule illustrates how content is
tests can be used to provide an analysis of every element in a document:
element #implied output "%n<%q>: " do when content is element output "element" else when content is any output "any" else when content is mixed output "mixed" else when content is cdata output "cdata" else when content is rcdata output "rcdata" else when content is empty output "empty" done output " (conref)" when content is conref output "%n" ; Finally, process the content: output "%c"