Documentation Center

How to use mixed content

Using mixed content may cause problems unless you apply this attribute carefully.

Using mixed="true" can sometimes cause issues for SDL LiveContent Create . The following XML is an example of what might not work well in SDL LiveContent Create , 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 SDL LiveContent Create , since SDL LiveContent Create will have a difficult time to split paragraphs, list items and show other strange behavior 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, therefore more like a container. Further configuration, throughtemplate , can be used to automatically create the content. Note that in the examples they were not required due to the use of the minOccurs="0" attribute.