Dynamic View Services > Specifying Dynamic View Types > Basic Specification > XML View Specification
 
XML View Specification
The specification of the dynamic view type can be described with an XML document. This document can be a file, a string, or a Document Object Model (DOM). See class IlsMvServer for details.
The XML document must be validated with the ILS DTD. This DTD can be found in the ILSHOME/data directory : ils.dtd
To validate an ILS XML document, you must specify a prolog such as:
<!DOCTYPE ils:view-type-spec SYSTEM '..\..\data\ils.dtd'>
so as to include the DTD specification. You must adapt the system path so that it references a valid ILS DTD (URLs are not supported).
Example
The following table shows the XML equivalent of an view specification .ils file written in View Specification Language.
ILS versus XML View Specification
ILS Specification
ILS XML View Specification
 
<?xml version='1.0' encoding='UTF-8'?>
 
<!DOCTYPE ils:view-type-spec SYSTEM '...\ils.dtd'>
 
<ils:view-type-spec xmlns:ils='http://www.roguewave.fr/ils/1.0'>
 
<ils:subscribe origin='true' type='Company'>
 
<ils:represent class="TreeR" name="root">
 
<ils:attr-mapping type="string" name="label">
 
<ils:path><ils:simple-path name="identifier"/></ils:path>
 
</ils:attr-mapping>
view CompanyTree:
</ils:represent>
subscribe origin Company:
<ils:propagate rel-name="departements"/>
represent TreeR root:
</ils:subscribe>
string label = identifier;
 
propagate departements;
<ils:subscribe type='Department'>
 
<ils:represent class="TreeItemR" name="item">
subscribe Department:
<ils:ref-mapping class="TreeR" name="ownerTree">
represent TreeItemR item:
<ils:repres-path>
Ref<TreeR> ownerTree = company->root;
<ils:path>
string label = name;
<ils:simple-path name="company"/>
 
</ils:path>
 
<ils:rp-name name="root"/>
 
</ils:repres-path>
 
</ils:ref-mapping>
 
<ils:attr-mapping type="string" name="label">
 
<ils:path><ils:simple-path name="name"/></ils:path>
 
</ils:attr-mapping>
 
</ils:represent>
 
</ils:subscribe>
 
</ils:view-type-spec>
An example of a dynamic view type that uses all the ILS XML tag can be found in the dynserver demo in the following directory:
ILSHOME/demo/dynserver/network/data/test.xml

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.