include

Purpose

Used to include XDIME fragments, or dynamic content from the DCI pipeline. If content is not found a processing error is thrown. If the pipeline content is invalid a streaming error is thrown.

Attributes

Attribute Description Type Default Options Use
encoding The character encoding of the included content. Has no effect when parse is set to 'xml'. xs:string none    optional 
expr An MCS expression xs:string none    optional 
href The URI to retrieve xs:anyURI none    optional 
parse Whether to treat the included content as XML or literal text. xs:string xml  xml, text  optional 

Examples

The included content may be treated as XML.

<?xml version="1.0" encoding="UTF-8"?>
<canvas layoutName="/welcome.mlyt" pageTitle="include">
  <pane name="background">
    <h3>Hello World!!!</h3>
    <include href="test.xdinc" parse="xml"/>
  </pane>
</canvas>

Where, test.xdinc contains the following code:

<unit>
  <p>Copyright 2009 All rights reserved.</p>
</unit>

The included content may also be treated as literal text.

<?xml version="1.0" encoding="UTF-8"?>
<canvas layoutName="/welcome.mlyt" pageTitle="include">
  <pane name="background">
    <h3>Hello World!!!</h3>
    <p>
      <include href="test.xdinc" parse="text" encoding="utf-8"/>
    </p>
  </pane>
</canvas>

Where, test.xdinc contains the following code:

Copyright 2009 All rights reserved.

The welcome.mlyt layout can be found in the MCS/repository/xml-repository directory.

Related topics