It is possible to nest an XDIME 2 document (i.e. an html element and its descendants) inside the body of another XDIME 2 document. The nested html element is treated as if it was a block element; it can appear anywhere a block element can appear and behaves similarly, e.g. can be targeted at layouts, styled, etc. XDIME 2 documents can be nested to any depth, i.e. a sub-document can itself contain a sub-sub-document, and so on.
It is possible to nest an XDIME 2 document (i.e. an html element and its descendants) inside the body of another XDIME 2 document. The nested html element is treated as if it was a block element; it can appear anywhere a block element can appear and behaves similarly, e.g. can be targeted at layouts, styled, etc. XDIME 2 documents can be nested to any depth, i.e. a sub-document can itself contain a sub-sub-document, and so on.
If the existing MCS documentation refers to an html element it refers to the closest enclosing html element unless otherwise stated. For example, if a meta element applies to a document, e.g. because it has no about attribute or it is set to '#', then it applies to the closest enclosing html element.
The following restrictions apply to a nested XDIME 2 document:
The title element is required within a sub-document, but it is ignored by MCS.
The default layout and themes are applied to nested html elements and are retrieved from the project associated with the nested html element itself. For example, let's consider the following nested document:
<html xml:base="file:/webapps/mcs.war/projects/alpha/main.xdime">
...
<body>
...
<html xml:base="file:/webapps/mcs.war/projects/beta/sub.xdime">
...
<body>
...
</body>
</html>
...
</body>
</html>
The outermost html element will use the default layout and themes from file:/webapps/mcs.war/projects/alpha/mcs-project.xml, and the nested html element will use the default layout and themes from file:/webapps/mcs.war/projects/beta/mcs-project.xml.
The viewport layout can only be specified within the outermost html element.
html is the root element of an XDIME 2 page fragment. Each html element is associated with an anonymous region into which all the content from that fragment and any nested fragments is rendered, and therefore it is not possible to target content from one page fragment into the layout associated by an enclosing page fragment. Also note that when you assign the mcs-container property to an element it causes that element and all its contents to be targeted to that layout container. In such a case nested page fragments MUST be targeted at regions.
Navigation links can only be specified within the outermost html element.
The following meta properties can only be specified within the outermost html element:
mcs:refresh
mcs:allow-css-type-selectors
mcs:page-supports-resize
The mcs:styling-mode meta property is always set to 'all' for the nested html elements and it is an error if this meta property is explicitly set for any nested html elements.
The cf2:validation-mode meta property on a nested html element is inherited from the containing html element. However, if the meta property is specified on the nested html element, then its value will override the inherited value.
id attributes have to be unique across all the elements in the page.
Each html element has its own ID space that is separate from its parent and all its nested documents, and therefore it is not possible to reference an element by id within a different html element. This restriction applies to the Client Framework 2 components and meta properties, i.e. the about attribute. However, this restriction does not apply to using id attributes as fragment identifiers within an href attribute to provide navigation to any element in the page, including elements in different documents.
Cache control meta properties apply to the closest enclosing html element, and the output meta properties and HTTP headers are the result of merging together all the cache control information from each of the nested html elements. Please note that MCS will use the smallest value of the max-age attribute. In addition, if any part of the page cannot be cached, then none of it will be cached.
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns:mcs="http://www.volantis.com/xmlns/2006/01/xdime/mcs"
xmlns="http://www.w3.org/2002/06/xhtml2">
<head>
<title>Nested XDIME 2 Example</title>
</head>
<body>
<p id="id1">Some text before the nested page.</p>
<html>
<head>
<title>Required but ignored</title>
</head>
<body>
<p id="id2">Some text inside the nested page.</p>
</body>
</html>
<p id="id3">Some text after the nested page.</p>
</body>
</html>