Mixed Content

Using mixed="true" can sometimes cause issues for Xopus. The following XML is an example of what might not work well in Xopus, editing wise.

The following schema definition:

<xs:element name="section" mixed="true">
  <xs:complexType>
    <xs:choice minOccurs="0">
      <xs:element name="title" type="xs:string"/>
      <xs:element name="paragraph" type="p.type" maxOccurs="unbounded"/>
    </xs:choice>
  </xs:complexType>
</xs:element>

...

Can cause the following XML:

<section>
  some text about something, with some <b>bold text</b> and then
    <paragraph>
      more text
    </paragraph>
</section>

The <paragraph> in the above example behaves as an inline element, similar to bold and italic, being inline with text. This can be confusing to Xopus, since Xopus will have a difficult time to split paragraphs, list items and show other strange behaviour when editing.

The problem and solution

Sometimes schema's cannot be adjusted, but content however tends to, or should be structured to the more stricter model, where there is no text allowed within the section, and it should have a <title> and <paragraph>.

Configuration can be used to configure the section node to behave as a mixed="false" element, more like a container therefore. Further configuration, through templates, can be used to automatically create the content, since in the example these are not required (by the minOccurs="0" attribute)