Symbian3/PDK/Source/GUID-5012D63B-4353-5616-BBFB-DB04DAF71679.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Fri, 22 Jan 2010 18:26:19 +0000
changeset 1 25a17d01db0c
child 3 46218c8b8afa
permissions -rw-r--r--
Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     6
<!-- Initial Contributors:
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     7
    Nokia Corporation - initial contribution.
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     8
Contributors: 
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     9
-->
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    10
<!DOCTYPE concept
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    12
<concept id="GUID-5012D63B-4353-5616-BBFB-DB04DAF71679" xml:lang="en"><title>XmlExample:
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    13
Using the XML framework to parse an XML file</title><prolog><metadata><keywords/></metadata></prolog><conbody>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    14
<section id="GUID-7860D226-83AD-501E-9431-6A61A9AC2996"><title>Download</title> <p>Click
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    15
on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-3eef58b5-bcd4-4f1e-a864-71273651c3bb.zip" scope="external">XmlExample.zip</xref></p><p>Click:<xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-3eef58b5-bcd4-4f1e-a864-71273651c3bb.html" scope="peer">browse</xref> to view the example code. </p> </section>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    16
<section><title>Introduction</title> <p>This example application demonstrates
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    17
the usage of the <xref href="GUID-5748D958-9480-3358-A399-6B92293B86D9.dita"><apiname>XML</apiname></xref> framework API to parse XML and WBXML
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    18
files. </p> <p>The overview contains the following sections: </p> <ul>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    19
<li id="GUID-01C9B600-A55E-55D8-AA35-057464345A45"><p> <xref href="GUID-5012D63B-4353-5616-BBFB-DB04DAF71679.dita#GUID-5012D63B-4353-5616-BBFB-DB04DAF71679/GUID-3A5027A1-BEE9-5EB4-8670-7E729CF9260F">Description</xref>  </p> </li>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    20
<li id="GUID-656E68A4-BAF3-505B-AC9A-96C6A9107E1B"><p> <xref href="GUID-5012D63B-4353-5616-BBFB-DB04DAF71679.dita#GUID-5012D63B-4353-5616-BBFB-DB04DAF71679/GUID-5dfd0234-44cf-4252-a980-5b73aaa61e35">Class summary</xref>  </p> </li>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    21
<li id="GUID-F8CEA6F8-D4AB-5E32-9EC1-9FACED6F34B5"><p> <xref href="GUID-5012D63B-4353-5616-BBFB-DB04DAF71679.dita#GUID-5012D63B-4353-5616-BBFB-DB04DAF71679/GUID-E9F975CA-A59F-5484-83FD-7F17F0A03807">Build</xref>  </p> </li>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    22
</ul> </section>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    23
<section id="GUID-3A5027A1-BEE9-5EB4-8670-7E729CF9260F"><title>Description</title> <p>The
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    24
example application demonstrates, how to use the <xref href="GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473.dita"><apiname>Xml</apiname></xref> framework
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    25
to parse XML and WBXML files. It takes a valid XML file with a DTD (Document
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    26
Type Declaration) definining its structure, and a WBXML (WAP Binary XML format)
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    27
file as input. You can generate a WBXML file from an XML file using any freeware
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    28
converters. The application's <filepath>bld.inf</filepath> file specifies
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    29
the target path to which all the three files (XML, DTD, WBXML) need to be
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    30
exported. </p> <p>The application implements all the pure virtual functions
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    31
of the <xref href="GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473.dita#GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473/GUID-25E466A4-0578-3BED-A56D-4E0906313788"><apiname>Xml::MContentHandler</apiname></xref> class, which is a client interface
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    32
to the <xref href="GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473.dita"><apiname>Xml</apiname></xref> framework. These functions inform the client
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    33
application about the XML element being parsed, its content, parser errors
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    34
if any and so on. </p> <p>The XML and WBXML files are parsed using an object
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    35
of the <xref href="GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473.dita#GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473/GUID-EE37CB28-DAB4-30A9-B46E-8AE4664B28DE"><apiname>Xml::CParser</apiname></xref> class. The parser object is configured
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    36
to report namespace mappings to the client application, using the function <xref href="GUID-EE37CB28-DAB4-30A9-B46E-8AE4664B28DE.dita#GUID-EE37CB28-DAB4-30A9-B46E-8AE4664B28DE/GUID-5F2688CC-16B3-3F0D-B6CA-CE59FE7939BD"><apiname>Xml::CParser::EnableFeature()</apiname></xref>. </p> <p>The
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    37
application first opens a file session using <xref href="GUID-E263C747-946F-35AA-9F1D-41833BD350FC.dita"><apiname>RFs</apiname></xref> to read
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    38
the XML and WBXML files. Then, the <xref href="GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473.dita#GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473/GUID-CC810749-2F0D-3CC0-911D-EE12BB934867"><apiname>Xml::ParseL()</apiname></xref> function
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    39
is called to start parsing the files. The application parses the XML file
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    40
followed by the WBXML file. While these files are being parsed, status messages
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    41
are printed to the console by the callback functions as and when they are
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    42
invoked. </p> <p>For demonstration purposes, the XML file is parsed twice,
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    43
once by the <xref href="GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473.dita#GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473/GUID-EE37CB28-DAB4-30A9-B46E-8AE4664B28DE"><apiname>Xml::CParser</apiname></xref> object created using the MIME
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    44
type and again by the <codeph>CParser</codeph> object created using match
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    45
data criteria. The match data criteria are specified using an object of the <xref href="GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473.dita#GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473/GUID-AEFF2DB4-FBC2-36EE-A4CE-7EBBD4AF004E"><apiname>Xml::CMatchData</apiname></xref> class,
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    46
which is passed to the <xref href="GUID-EE37CB28-DAB4-30A9-B46E-8AE4664B28DE.dita#GUID-EE37CB28-DAB4-30A9-B46E-8AE4664B28DE/GUID-9E9D8DBA-A396-3F62-8B59-C4556FD5A80E"><apiname>Xml::CParser::NewLC()</apiname></xref> function while
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    47
creating the parser object. This will return a <codeph>CParser</codeph> object
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    48
that matches the specified MIME type, variant and so on. </p> </section>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    49
<section id="GUID-5DFD0234-44CF-4252-A980-5B73AAA61E35"><title>Class summary</title><p> <xref href="GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473.dita#GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473/GUID-25E466A4-0578-3BED-A56D-4E0906313788"><apiname>Xml::MContentHandler </apiname></xref><xref href="GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473.dita#GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473/GUID-88087934-B84B-39DD-907F-71328D684035"><apiname>Xml::RDocumentParameters </apiname></xref><xref href="GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473.dita#GUID-54A442BD-FCF1-31D3-BEF7-598C1820F473/GUID-A8A238B9-48A5-3729-9BAE-0287EE6295FA"><apiname>Xml::RAttributeArray </apiname></xref><xref href="GUID-DEFFFAAD-662A-34E9-8955-759F37BDC9AB.dita#GUID-DEFFFAAD-662A-34E9-8955-759F37BDC9AB/GUID-9A8E865C-FDAC-3923-83A9-5A8680AEE1EE"><apiname>Xml::CParserXml::CMatchData </apiname></xref> </p></section>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    50
<section id="GUID-E9F975CA-A59F-5484-83FD-7F17F0A03807"><title>Build</title> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian platform build process</xref> describes
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    51
how to build an application. </p> <p>The <codeph>XmlExample</codeph> builds
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    52
an executable called <filepath>xmlexample.exe</filepath> in the standard location
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    53
(<filepath>\epoc32\release\winscw\&lt;build_variant&gt;</filepath> for CodeWarrior).
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    54
After launching the executable, depending on the emulator you are using, you
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    55
may need to task away from the application launcher/shell screen to view the
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    56
console. </p> </section>
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    57
</conbody></concept>