Fixed Values

Sometimes documents need to include specific values for particular content. The value pattern can check fixed values, such as version identifiers of XML vocabularies. The syntax and semantics of the value pattern are straightforward: the pattern is matched only if the value found in the instance document matches the value specified in the value pattern. For example, if you want a highly specialized vocabulary to describe the book with the ISBN number 0836217462 and only this specific book, you can replace the text pattern with a value pattern and write:

<element name="isbn">
  <value>0836217462</value>
</element>

or, using the compact syntax:

element isbn {"0836217462"}

and the schema will validate a book with a ISBN number equal to 0836217462 and refuse any other ISBN number.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.22.216