7 Nokia Corporation - initial contribution. |
7 Nokia Corporation - initial contribution. |
8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept xml:lang="en" id="GUID-33D50AB9-AFA8-521F-8A85-031C24EA7D25"><title>Libxml2 Overview</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This section describes the libxml2 component which is a wrapper for the standard libxml2 C library. </p> <section><title>Purpose</title> <p>The libxml2 component provides XML processing, parsing and validation APIs. You can call its C functions directly or use the C++ wrapper. </p> </section> <section><title>Required background</title> <p>The libxml2 component is based on the standard <xref scope="external" href="http://xmlsoft.org/">libxml2</xref> library. </p> </section> <section><title>Architecture</title> <p>The libxml2 component is the core of the XML collection. Two other components rely on it: the <xref href="GUID-F79E4F18-19E2-577E-8409-8B82BD48AC66.dita">XML Framework</xref> and the <xref href="GUID-5ACFA8E4-3C4B-5851-A43E-9FA72D0B8403.dita">XML DOM Engine</xref>. </p> <fig id="GUID-4EE5466D-6370-5ED5-9BAA-838F5413AAE5"><title> |
12 <concept id="GUID-33D50AB9-AFA8-521F-8A85-031C24EA7D25" xml:lang="en"><title>Libxml2 |
13 Package diagram for the libxml2 component |
13 Overview</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
14 </title> <image href="GUID-873186CE-9723-558F-9C7E-0CEE607F076C_d0e669305_href.png" placement="inline"/></fig> <p>The libxml2 sub-component provides direct access to the C API of the standard libxml2 library. </p> <p>The Utilities sub-component provides object-oriented access to the C functions: it also implements the resource management and error handling capabilities of Symbian Platform. </p> <p>If your Symbian Platform build does not include the libxml2 component, the XML DOM Engine and the libxml2 SAX parser plug-in are automatically excluded. </p> </section> <section><title>APIs</title> <p>The <xref href="GUID-321A32BB-75B1-38B4-A8F5-BF69D1F041FD.dita"><apiname>XMLEngPushL()</apiname></xref> function opens and initializes the libxml2 library parser. The <xref href="GUID-64E53D09-2F54-3188-A1D4-F541BDC40240.dita"><apiname>XMLEngPopAndClose()</apiname></xref> function closes the library parser and frees its resources. You must call the <xref href="GUID-321A32BB-75B1-38B4-A8F5-BF69D1F041FD.dita"><apiname>XMLEngPushL()</apiname></xref> function before any parsing and serialisation operations, and call the <xref href="GUID-64E53D09-2F54-3188-A1D4-F541BDC40240.dita"><apiname>XMLEngPopAndClose()</apiname></xref> function when these operations are completed. </p> <p>The following table lists the most relevant wrapper classes of the libxml2 library. High-level classes are in the <xref href="GUID-5ACFA8E4-3C4B-5851-A43E-9FA72D0B8403.dita">XML DOM Engine</xref> component. </p> <table id="GUID-9A8FA78F-CF35-5897-AD8E-B35B7CFF63D9"><tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/><thead><row><entry>API</entry> <entry>Description</entry> </row> </thead> <tbody><row><entry><p> <xref href="GUID-1DA29392-2F71-36CA-865F-B6616E1506F8.dita"><apiname>xmlGlobalState</apiname></xref> </p> </entry> <entry><p>Global data providing access to most of the libxml2 library: settings, function pointers, and so on. Available through TLS </p> </entry> </row> <row><entry><p> <xref href="GUID-2B22200A-55E0-3428-94FE-332224003D68.dita"><apiname>TXmlEngString</apiname></xref> </p> </entry> <entry><p>General-purpose string: pointer-sized object containing a zero-terminated UTF-8 string. </p> </entry> </row> <row><entry><p> <xref href="GUID-E0D0625F-C100-3B83-A385-D3702D5AD434.dita"><apiname>TXmlEngConstString</apiname></xref> </p> </entry> <entry><p>Read-only version of <codeph>TXmlEngString</codeph>. </p> </entry> </row> </tbody> </tgroup> </table> <p>The following table lists the most relevant C structures of the libxml2 library. </p> <table id="GUID-3AE5C214-E832-5331-9243-534265A5DF9F"><tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/><thead><row><entry>API</entry> <entry>Description</entry> </row> </thead> <tbody><row><entry><p> <xref href="GUID-5257133A-35CC-3D8D-B56C-E865B45A95D2.dita"><apiname>_xmlDoc</apiname></xref> </p> </entry> <entry><p>Document. Provides access to the tree of nodes. </p> </entry> </row> <row><entry><p> <xref href="GUID-870927E4-4D27-3A49-9672-8C336D8817C3.dita"><apiname>_xmlNode</apiname></xref> </p> </entry> <entry><p>Node. Provides access to its children and chain of attributes. </p> </entry> </row> <row><entry><p> <xref href="GUID-204C12B5-8D50-3BBB-8CFC-20036F3AB787.dita"><apiname>_xmlAttribute</apiname></xref> </p> </entry> <entry><p>Attribute. </p> </entry> </row> <row><entry><p> <xref href="GUID-354C802A-33D5-3E3B-9FAE-C0CD8CE6329C.dita"><apiname>_xmlElement</apiname></xref> </p> </entry> <entry><p>Element. </p> </entry> </row> <row><entry><p> <xref href="GUID-3A2A7AE7-C1FF-3534-9319-400D3B57EC85.dita#GUID-3A2A7AE7-C1FF-3534-9319-400D3B57EC85/GUID-59610388-E6CA-3A12-8403-63D12A2D741B"><apiname>xmlAttributeType::_xmlElementContent</apiname></xref> </p> </entry> <entry><p>Container for the contents of an element. </p> </entry> </row> <row><entry><p> <xref href="GUID-5CF7019B-3D9B-369E-B81C-72D2D2DD1375.dita"><apiname>_xmlSchema</apiname></xref> and <xref href="GUID-2AA3571C-0A78-3C42-8FA2-219E642C2218.dita"><apiname>_xmlDtd</apiname></xref> </p> </entry> <entry><p>Validation trees. These structures have no C++ wrappers. </p> </entry> </row> <row><entry><p> <xref href="GUID-50CFFAE0-5B6D-342D-B372-642055EF7367.dita"><apiname>_xmlXPathParserContext</apiname></xref> </p> </entry> <entry><p>XPath evaluation context. </p> </entry> </row> </tbody> </tgroup> </table> </section> <section><title>Typical uses</title> <p>When porting existing software, use the C functions of the standard libxml2 library and refer to the <xref scope="external" href="http://xmlsoft.org/html/index.html">libxml2 Reference Manual</xref> for more information. </p> <p>To take advantage of the standard types and exception handling provided by Symbian Platform, use the C++ APIs. </p> </section> </conbody><related-links><link href="GUID-77ECD89F-84BB-55F1-9876-382E043F0C0D.dita"><linktext>XML DOM Engine error handling</linktext> </link> </related-links></concept> |
14 <p>This section describes the libxml2 component which is a wrapper for the |
|
15 standard libxml2 C library. </p> |
|
16 <section id="GUID-F78E0EE2-A612-4AB4-9EBF-09B220780574"><title>Purpose</title> <p>The libxml2 component provides XML processing, |
|
17 parsing and validation APIs. You can call its C functions directly or use |
|
18 the C++ wrapper. </p> </section> |
|
19 <section id="GUID-B4508A67-D97E-4EEA-801A-0AB808B695C8"><title>Required background</title> <p>The libxml2 component is based |
|
20 on the standard <xref href="http://xmlsoft.org/" scope="external">libxml2</xref> library. </p> </section> |
|
21 <section id="GUID-4B29685C-200B-42F0-8DD1-C93242843C63"><title>Architecture</title> <p>The libxml2 component is the core |
|
22 of the XML collection. Two other components rely on it: the <xref href="GUID-F79E4F18-19E2-577E-8409-8B82BD48AC66.dita">XML |
|
23 Framework</xref> and the <xref href="GUID-5ACFA8E4-3C4B-5851-A43E-9FA72D0B8403.dita">XML |
|
24 DOM Engine</xref>. </p> <fig id="GUID-4EE5466D-6370-5ED5-9BAA-838F5413AAE5"> |
|
25 <title> Package diagram for the libxml2 component </title> |
|
26 <image href="GUID-873186CE-9723-558F-9C7E-0CEE607F076C_d0e688354_href.png" placement="inline"/> |
|
27 </fig> <p>The libxml2 sub-component provides direct access to the C API of |
|
28 the standard libxml2 library. </p> <p>The Utilities sub-component provides |
|
29 object-oriented access to the C functions: it also implements the resource |
|
30 management and error handling capabilities of the Symbian Platform. </p> <p>If |
|
31 your Symbian Platform build does not include the libxml2 component, the XML |
|
32 DOM Engine and the libxml2 SAX parser plug-in are automatically excluded. </p> </section> |
|
33 |
|
34 <section id="GUID-BB2FC62C-E8AB-42CF-BFC1-FC7CA5EDB9DC"><title>APIs</title> <p>The <xref href="GUID-321A32BB-75B1-38B4-A8F5-BF69D1F041FD.dita"><apiname>XMLEngPushL()</apiname></xref> function |
|
35 opens and initializes the libxml2 library parser. The <xref href="GUID-64E53D09-2F54-3188-A1D4-F541BDC40240.dita"><apiname>XMLEngPopAndClose()</apiname></xref> function |
|
36 closes the library parser and frees its resources. You must call the <xref href="GUID-321A32BB-75B1-38B4-A8F5-BF69D1F041FD.dita"><apiname>XMLEngPushL()</apiname></xref> function |
|
37 before any parsing and serialisation operations, and call the <xref href="GUID-64E53D09-2F54-3188-A1D4-F541BDC40240.dita"><apiname>XMLEngPopAndClose()</apiname></xref> function |
|
38 when these operations are completed. </p> <p>The following table lists the |
|
39 most relevant wrapper classes of the libxml2 library. High-level classes are |
|
40 in the <xref href="GUID-5ACFA8E4-3C4B-5851-A43E-9FA72D0B8403.dita">XML DOM Engine</xref> component. </p> <table id="GUID-9A8FA78F-CF35-5897-AD8E-B35B7CFF63D9"> |
|
41 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
42 <thead> |
|
43 <row> |
|
44 <entry>API</entry> |
|
45 <entry>Description</entry> |
|
46 </row> |
|
47 </thead> |
|
48 <tbody> |
|
49 <row> |
|
50 <entry><p> <xref href="GUID-1DA29392-2F71-36CA-865F-B6616E1506F8.dita"><apiname>xmlGlobalState</apiname></xref> </p> </entry> |
|
51 <entry><p>Global data providing access to most of the libxml2 library: settings, |
|
52 function pointers, and so on. Available through TLS </p> </entry> |
|
53 </row> |
|
54 <row> |
|
55 <entry><p> <xref href="GUID-2B22200A-55E0-3428-94FE-332224003D68.dita"><apiname>TXmlEngString</apiname></xref> </p> </entry> |
|
56 <entry><p>General-purpose string: pointer-sized object containing a zero-terminated |
|
57 UTF-8 string. </p> </entry> |
|
58 </row> |
|
59 <row> |
|
60 <entry><p> <xref href="GUID-E0D0625F-C100-3B83-A385-D3702D5AD434.dita"><apiname>TXmlEngConstString</apiname></xref> </p> </entry> |
|
61 <entry><p>Read-only version of <codeph>TXmlEngString</codeph>. </p> </entry> |
|
62 </row> |
|
63 </tbody> |
|
64 </tgroup> |
|
65 </table> <p>The following table lists the most relevant C structures of the |
|
66 libxml2 library. </p> <table id="GUID-3AE5C214-E832-5331-9243-534265A5DF9F"> |
|
67 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
68 <thead> |
|
69 <row> |
|
70 <entry>API</entry> |
|
71 <entry>Description</entry> |
|
72 </row> |
|
73 </thead> |
|
74 <tbody> |
|
75 <row> |
|
76 <entry><p> <xref href="GUID-5257133A-35CC-3D8D-B56C-E865B45A95D2.dita"><apiname>_xmlDoc</apiname></xref> </p> </entry> |
|
77 <entry><p>Document. Provides access to the tree of nodes. </p> </entry> |
|
78 </row> |
|
79 <row> |
|
80 <entry><p> <xref href="GUID-870927E4-4D27-3A49-9672-8C336D8817C3.dita"><apiname>_xmlNode</apiname></xref> </p> </entry> |
|
81 <entry><p>Node. Provides access to its children and chain of attributes. </p> </entry> |
|
82 </row> |
|
83 <row> |
|
84 <entry><p> <xref href="GUID-204C12B5-8D50-3BBB-8CFC-20036F3AB787.dita"><apiname>_xmlAttribute</apiname></xref> </p> </entry> |
|
85 <entry><p>Attribute. </p> </entry> |
|
86 </row> |
|
87 <row> |
|
88 <entry><p> <xref href="GUID-354C802A-33D5-3E3B-9FAE-C0CD8CE6329C.dita"><apiname>_xmlElement</apiname></xref> </p> </entry> |
|
89 <entry><p>Element. </p> </entry> |
|
90 </row> |
|
91 <row> |
|
92 <entry><p> <xref href="GUID-3A2A7AE7-C1FF-3534-9319-400D3B57EC85.dita#GUID-3A2A7AE7-C1FF-3534-9319-400D3B57EC85/GUID-59610388-E6CA-3A12-8403-63D12A2D741B"><apiname>xmlAttributeType::_xmlElementContent</apiname></xref> </p> </entry> |
|
93 <entry><p>Container for the contents of an element. </p> </entry> |
|
94 </row> |
|
95 <row> |
|
96 <entry><p> <xref href="GUID-5CF7019B-3D9B-369E-B81C-72D2D2DD1375.dita"><apiname>_xmlSchema</apiname></xref> and <xref href="GUID-2AA3571C-0A78-3C42-8FA2-219E642C2218.dita"><apiname>_xmlDtd</apiname></xref> </p> </entry> |
|
97 <entry><p>Validation trees. These structures have no C++ wrappers. </p> </entry> |
|
98 </row> |
|
99 <row> |
|
100 <entry><p> <xref href="GUID-50CFFAE0-5B6D-342D-B372-642055EF7367.dita"><apiname>_xmlXPathParserContext</apiname></xref> </p> </entry> |
|
101 <entry><p>XPath evaluation context. </p> </entry> |
|
102 </row> |
|
103 </tbody> |
|
104 </tgroup> |
|
105 </table> </section> |
|
106 <section id="GUID-C302F9A6-7E2C-4CC3-991D-F653C4877C56"><title>Typical uses</title> <p>When porting existing software, use |
|
107 the C functions of the standard libxml2 library and refer to the <xref href="http://xmlsoft.org/html/index.html" scope="external">libxml2 Reference Manual</xref> for more information. </p> <p>To |
|
108 take advantage of the standard types and exception handling provided by the |
|
109 Symbian Platform, use the C++ APIs. </p> </section> |
|
110 </conbody><related-links> |
|
111 <link href="GUID-77ECD89F-84BB-55F1-9876-382E043F0C0D.dita"><linktext>XML DOM Engine |
|
112 error handling</linktext></link> |
|
113 </related-links></concept> |