1.3. X-script of elements and text nodes

Now we will show how to specify the child nodes of an element and how to write the X-script of the elements. The X-script of the element must be written in the special attribute "xd:script" (the prefix "xd" must match the namespace of the X-definition: "http://www.xdef.org/xdef/4.2").
In the example below we added the child elements "Title" and "Author". Both child elements contain a required text node. The X-script of the text node is written as the value of the text node. Consider that there are books with one author, multiple authors, or even no author. Therefore, the quantifier of the "Author" element is specified as "occurs *" (i.e., none or multiple occurrences) in the X-script of the model element. However, the child element "Title" must be just one (i.e. it is required):

<Book ISBN="required int(10000000, 999999999);"
      published="optional gYear();" > 
  <Author xd:script="occurs *;" >
        required string(); /* name of author */"
  </Author>
  <Title xd:script="required;" >
        required string(); /* title of the book */"
   </Title>
</Book>

Since the default value of quantifier is "required" notice that the specification of such quantifier can be omitted:

<Book ISBN="int(0, 9999999999);" published="optional gYear();" >
  <Author xd:script="occurs *;" > string(); </Author>
  <Title string(); </Title>
</Book>