Name
rng:value — Matches a specific value, including a value from a specified datatype
XML syntax example
<element name="answer"> <choice> <value>yes</value> <value>no</value> <value>true</value> <value>false</value> </choice> </element> <element name="value" datatypeLibrary="http://www.w3.org/ 2001/XMLSchema-datatypes"> <choice><value type="string">one</value>
<value type="integer">1</value>
<value type="decimal">1.0</value>
</choice> </element>
Compact syntax example
element answer {"yes" | "no" | "true" | "false"
} element value {xsd:string "one" | xsd:integer "1" | xsd:decimal "1.0"
}
Attributes
type
A datatype from the datatype library that is specified with the nearest
datatypeLibrary
attribute
Parents
attribute
, choice
((
)
and |
), define
(name of pattern followed by
=
), element
, except
(-
), group
((
)
and ,
), interleave
(&
), list
, mixed
, oneOrMore
(+
), optional
(?
), start
(start
followed by =
), zeroOrMore
(*
)
Description
The value
pattern matches a
specific value from an enumeration or, when using the type
attribute, a value from a specific
datatype. The value of the type
attribute may match any legal value of a specified datatype library
such as the XML Schema datatype library. The datatype library is
specified by the value of the datatypeLibrary
attribute. Child or
descendant elements inherit the value of datatypeLibrary
; hence datatypeLibrary
is often specified on the
document element. Datatypes can be restricted using the param
element. In the compact syntax, the datatype ...
Get XML Pocket Reference, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.