Name

optional — optional pattern

Synopsis

element optional
{
 (
 attribute ns { text }?,
 attribute datatypeLibrary { xsd:anyURI }?,
 attribute * - (rng:* | local:*) { text }*
 ),
 (
 ( element * - rng:* { ... }* )
 & (
 element element { ... }
 | element attribute { ... }
 | element group { ... }
 | element interleave { ... }
 | element choice { ... }
 | element optional { ... }
 | element zeroOrMore { ... }
 | element oneOrMore { ... }
 | element list { ... }
 | element mixed { ... }
 | element ref { ... }
 | element parentRef { ... }
 | element empty { ... }
 | element text { ... }
 | element value { ... }
 | element data { ... }
 | element notAllowed { ... }
 | element externalRef { ... }
 | element grammar { ... }
 )+
 )
}

Class

pattern

May be included in

attribute, choice, define, element, except, group, interleave, list, mixed, oneOrMore, optional, start, zeroOrMore

Compact syntax equivalent

pattern?

Description

The optional pattern specifies that its subpatterns considered as an ordered group is optional, i.e., be matched zero or one times.

Example

<element name="author">
 <attribute name="id"/>
 <element name="name">
   <text/>
 </element>
 <element name="born">
   <text/>
   </element>
 <optional>
   <element name="died">
    <text/>
   </element>
  </optional>
 </element>
                 
<element name="name">
 <choice>
  <text/>
  <group>
   <element name="first"><text/></element>
   <optional>
    <element name="middle"><text/></element>
   </optional>
    <element name="last"><text/></element>
   </group>
  </choice>
 </element>

Attributes

datatypeLibrary

This attribute defines the default datatype library. The value is inherited.

ns

This attribute defines the default namespace for the elements defined in a portion of schema. The value is inherited.

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

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