Name

mixed — Pattern for mixed content models

Synopsis

element mixed
{
 (
 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

mixed

Description

The mixed pattern is a shortcut for interleave with an embedded text pattern. It describes unordered content models in which a text node may be included before and after each element. Note that RELAX NG doesn’t allow the addition of constraints on these text nodes.

Restrictions

The limitations of interleave apply here:

  • The mixed pattern can’t be used within a list.

  • Elements within a mixed pattern can’t have overlapping name classes.

  • There must no other text pattern in each set of patterns combined by mixed.

Example

<element name="title">
 <mixed>
  <attribute name="xml:lang"/>
  <zeroOrMore>
   <element name="a">
    <attribute name="href"/>
    <text/>
   </element>
  </zeroOrMore>
 </mixed>
</element>

This is equivalent to:

<element name="title">
 <interleave>
  <text/>
  <group>
    <attribute name="xml:lang"/>
    <zeroOrMore>
     <element name="a">
      <attribute name="href"/>
      <text/>
    </element>
    </zeroOrMore>
  </group>
 </interleave>
</element>

which itself is equivalent to:

<element name="title">
 <interleave>
  <text/>
  <attribute name="xml:lang"/>
  <zeroOrMore>
   <element name="a">
    <attribute name="href"/>
    <text/>
  </element>
  </zeroOrMore>
 </interleave>
</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 a 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
13.59.108.176