Symbian3/PDK/Source/GUID-99CC6D00-DC3E-51C2-8152-060FB80F5FCD.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 11 Mar 2010 18:02:22 +0000
changeset 3 46218c8b8afa
parent 1 25a17d01db0c
child 5 f345bda72bc4
permissions -rw-r--r--
week 10 bug fix submission (SF PDK version): Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-99CC6D00-DC3E-51C2-8152-060FB80F5FCD" xml:lang="en"><title>Composing
the XML Data</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>An MMS client may choose to use the SMIL composer to generate the presentation
part of outgoing messages, alternatively, it may use template SMIL files.
The first option results in a more flexible MMS composer, while the second
may be easier to implement. </p>
<section><title>Procedure</title> <ol id="GUID-10B85996-706E-5886-B0CB-254B14386863">
<li id="GUID-422300FD-099F-54DD-AEFB-6179F15934DE"><p><xref href="GUID-99CC6D00-DC3E-51C2-8152-060FB80F5FCD.dita#GUID-99CC6D00-DC3E-51C2-8152-060FB80F5FCD/GUID-E6F8AD16-4AEC-50DA-A234-5BFB1B54E44C">Build a DOM tree</xref>. </p> </li>
<li id="GUID-6AC3C78D-478B-5055-8275-0F9E264CD9A5"><p><xref href="GUID-99CC6D00-DC3E-51C2-8152-060FB80F5FCD.dita#GUID-99CC6D00-DC3E-51C2-8152-060FB80F5FCD/GUID-86533BEC-CF53-5F97-A5D9-A35392B70091">Generate XML data from the DOM tree</xref>. </p> </li>
</ol> <p id="GUID-E6F8AD16-4AEC-50DA-A234-5BFB1B54E44C"><b>Build a DOM tree</b> </p> <p>The
following steps are required to build the DOM tree: </p> <ol id="GUID-44FDC571-1E07-529B-B15A-F4106B7D5DE0">
<li id="GUID-6A5B91D2-8BC8-5A6F-9B48-02C564EBD877"><p>Create a <xref href="GUID-2A597821-BF7F-379A-A32C-99CF9B5CDFAA.dita"><apiname>CMDXMLDocument</apiname></xref> object. </p> </li>
<li id="GUID-9095F646-AA1C-5C8E-AB18-CF39FAB0E2E4"><p>Validate it using any
of the following methods, if required. </p> <ul>
<li id="GUID-5683A64F-25A0-5546-B23B-E6977F8614A2"><p>To validate SMIL data
as it is parsed, an instance of the SMIL DTD class must be passed to the <xref href="GUID-3AF26F84-F4C0-312D-9ABD-1C6EC0BD1675.dita"><apiname>CMDXMLParser</apiname></xref> on
construction. </p> </li>
<li id="GUID-07982E51-D361-5E59-9136-462F5ACF3731"><p>To validate SMIL composition,
the SMIL DTD class must be passed to the <xref href="GUID-2A597821-BF7F-379A-A32C-99CF9B5CDFAA.dita"><apiname>CMDXMLDocument</apiname></xref> on
construction. </p> </li>
</ul> <p> <b>Note: </b> The DTD class provided standard is the SMIL DTD; however
it is possible to implement others. In order to provide support for validating
other DTDs, it is necessary to derive a class from <xref href="GUID-F294DC1C-D762-3CF7-BB64-18E742BA6EAA.dita"><apiname>MXMLDtd</apiname></xref>. </p> </li>
<li id="GUID-FF8536D6-4037-56D5-9028-5ED1586B9879"><p>Call <xref href="GUID-2A597821-BF7F-379A-A32C-99CF9B5CDFAA.dita#GUID-2A597821-BF7F-379A-A32C-99CF9B5CDFAA/GUID-C6D821B2-7571-305C-A6D8-1B031BAE3774"><apiname>CMDXMLDocument::DocumentElement()</apiname></xref> to
get the root node of the DOM tree. </p> </li>
<li id="GUID-5DC5A1B2-5A5A-5BC1-923C-648B39937D4A"><p>Create a child node
of the required type, for example <xref href="GUID-DF432AB6-7895-30E8-9B4B-378E61A7A901.dita"><apiname>CMDXMLElement</apiname></xref> or <xref href="GUID-20E3DBF1-98CB-3B4D-AF93-38061F1E827A.dita"><apiname>CMDXMLComment</apiname></xref>. </p> </li>
<li id="GUID-D4E61C95-2811-5016-9750-E7CDBB684D26"><p>Add the node using <xref href="GUID-8BBCB6A5-A133-3BDD-8614-E5E2F1FED7E5.dita#GUID-8BBCB6A5-A133-3BDD-8614-E5E2F1FED7E5/GUID-F726866F-6CE0-34E5-B49C-7CC57B37BC1B"><apiname>CMDXMLNode::AppendChild()</apiname></xref>. </p> </li>
<li id="GUID-E83CDD32-A47D-55BF-A693-B561B4EA7947"><p>The tree can be navigated
as above, as more child nodes are added. </p> <p>Nodes can also be manipulated
by using the following functions: </p> <ul>
<li id="GUID-64E13F5C-D7DA-5BA5-89DA-B3D6AA7E94CB"><p> <xref href="GUID-8BBCB6A5-A133-3BDD-8614-E5E2F1FED7E5.dita#GUID-8BBCB6A5-A133-3BDD-8614-E5E2F1FED7E5/GUID-34A68CA0-F498-3D7F-963D-F4AE695E0094"><apiname>CMDXMLNode::RemoveChild()</apiname></xref>  </p> </li>
<li id="GUID-190BF096-EEB7-5B3B-9BF6-1D950EA0A56D"><p> <xref href="GUID-8BBCB6A5-A133-3BDD-8614-E5E2F1FED7E5.dita#GUID-8BBCB6A5-A133-3BDD-8614-E5E2F1FED7E5/GUID-97E6C080-E365-3B56-B30A-CB7FAB4C399F"><apiname>CMDXMLNode::InsertBefore()</apiname></xref>  </p> </li>
<li id="GUID-81622B01-DB8E-5F07-87D1-943D246403E9"><p> <xref href="GUID-8BBCB6A5-A133-3BDD-8614-E5E2F1FED7E5.dita#GUID-8BBCB6A5-A133-3BDD-8614-E5E2F1FED7E5/GUID-0C84FB21-298C-3295-A02E-D2F1005424A6"><apiname>CMDXMLNode::ReplaceChild()</apiname></xref>  </p> </li>
</ul> </li>
</ol> <p id="GUID-86533BEC-CF53-5F97-A5D9-A35392B70091"><b>Generate XML data
from the DOM tree</b> </p> <p>Once the DOM tree has been built it can be used
to generate the XML data. The following steps must be followed to compose
the data: </p> <ol id="GUID-7C5B89A4-77D5-5755-8B33-E6D61AEEE437">
<li id="GUID-952A92F5-FD89-5723-93F7-D0A09F716DD4"><p>Create an instance of <xref href="GUID-78751199-C2AA-37C4-970B-191C4D496AAA.dita"><apiname>CMDXMLComposer</apiname></xref>,
passing in an observer. </p> </li>
<li id="GUID-7897ABE8-8C44-512B-A5D6-F3E1D3F6E87A"><p>Call <xref href="GUID-78751199-C2AA-37C4-970B-191C4D496AAA.dita#GUID-78751199-C2AA-37C4-970B-191C4D496AAA/GUID-4252C6FB-970D-3ABB-A134-704C62CD4D52"><apiname>CMDXMLComposer::ComposeFile()</apiname></xref>,
passing in the name of the file where the XML data is to be written. </p> </li>
<li id="GUID-DD8EDCDD-3A0D-56F6-8923-2FF97DE100E8"><p>The composer calls the <xref href="GUID-5D55EC1A-8AF3-360F-A19C-FC93ED9312C6.dita#GUID-5D55EC1A-8AF3-360F-A19C-FC93ED9312C6/GUID-E230031A-8C89-3EC9-8D1A-F31A73723AAA"><apiname>MMDXMLComposerObserver::ComposeFileCompleteL()</apiname></xref> function
on the observer when it has completed. The observer can then check the composer
to see if the XML has been generated successfully. </p> </li>
</ol> </section>
</conbody><related-links>
<link href="GUID-FDC0004A-A2EE-5B73-9E2D-B6864C600AF9.dita"><linktext>SMIL Parser
Overview</linktext></link>
<link href="GUID-2468D736-9F95-5412-B687-765D630651C7.dita"><linktext>Parsing the
XML Data</linktext></link>
</related-links></concept>