
<topic>
    <title>Compiling XML Structure Definition and XSL</title>
    <shortdesc/>
    <body>
        <p>
             There are three input files that define presentation and functionality of XML within the editor: 
            <ul>
                <li>model.xml - definition of XML structure with supporting information</li>
                <li>XSL stylesheet - stylesheet defines exact rendering of the XML</li>
                <li>CSS stylesheet - styling used in the editing area </li>
            </ul>
        </p>
        <p>To optimize performance and improve user experience, XSL templates and XML structure definition file (model.xml) need to be compiled into corresponded JavaScript resource files. </p>
        <p>
            <image href='images/compilation.gif' align='center'/> 
        </p>
        <p>Output of the compilation process should be placed into editor 'config' directory replacing existing files.</p>
        <p>After that they could be consumed by the editor: </p>
        <p>
            <image href='images/DITAStormInput.gif'/> 
        </p>
        <p>
            Compilation process is simple and involves execution of command line script written in Java. Here is the sample usage of the script: 
            <codeblock>compile -model model.xml -xsl my_style.xsl</codeblock>
             If you would like to compile original model.xml and simple.xsl provided with the editor: 
            <codeblock>compile -model ../DITAStorm/config/model.xml \
    -xsl ../DITAStorm/config/simple.xsl \ 
    -modeljs ../DITAStorm/config/model.js \
    -xsljs ../DITAStorm/config/simple.xsl.js</codeblock>
             Provided command will replace two files: model.js and simple.xsl.js in the original DITAStorm configuration directory. 
            <note>If for some reason compilation script can not find java executable automatically, please set JAVA_HOME environment variable to point to the appropriate location.</note>
        </p>
    </body>
</topic>
