2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
20 * @brief This is the header file for the Tizen::Xml namespace.
22 * This header file contains the introduction of the Tizen::Xml namespace.
36 * @namespace Tizen::Xml
37 * @brief <i> [Deprecated] </i> This namespace contains interfaces to manipulate %XML documents.
39 * @deprecated This namespace is deprecated because Libxml2 open source library is supported by Tizen directly. Instead of using this namespace, use Libxml2 open source library directly.
43 * @remarks Include Libxml2 open source library header and use APIs directly without any additional setting.
49 * For more information about using Libxml2 open source library, visit <a href="http://www.xmlsoft.org" target="_blank">http://www.xmlsoft.org</a>
53 // Sample data - map.xml
54 <?xml version="1.0" encoding="ISO-8859-1" ?>
58 <country>United Arab Emirates</country>
59 <capital>Abu Dhabi</capital>
63 <country>Nigeria</country>
64 <capital>Abuja</capital>
68 <country>Ghana</country>
69 <capital>Accra</capital>
73 <country>Pitcairn Islands</country>
74 <capital>Adamstown</capital>
78 // Sample code for XmlSample.h
83 public Tizen::Ui::Controls::Form
91 virtual result OnInitializing(void);
94 // Sample code for XmlSample.cpp
95 #include <libxml/parser.h>
96 #include "XmlSample.h"
98 using namespace Tizen::Base;
101 XmlSample::OnInitializing(void)
103 xmlDocPtr pDocument = null;
104 xmlNodePtr pRoot = null;
105 xmlNodePtr pCurrentElement = null;
107 // Creates a XML document
108 pDocument = xmlParseFile("/Home/map.xml");
109 pRoot = xmlDocGetRootElement(pDocument);
111 for(pCurrentElement = pRoot->children; pCurrentElement; pCurrentElement = pCurrentElement->next)
114 xmlNodePtr pChildElement = null;
116 if(pCurrentElement->type == XML_ELEMENT_NODE)
118 // Gets the <country> element from the <item> element
119 pChildElement = pCurrentElement->children->next;
123 // Gets the content from XML_TEXT_NODE
124 Tizen::Base::Utility::StringUtil::Utf8ToString ((char*)pChildElement->children->content, countryName);
125 AppLog("country : %S\n", countryName.GetPointer());
130 xmlFreeDoc(pDocument);
139 #include <libxml/parser.h>
140 #include <libxml/HTMLparser.h>
141 #include <libxml/parserInternals.h>
142 #include <libxml/SAX.h>
143 #include <libxml/SAX2.h>
144 #include <libxml/xpath.h>
145 #include <libxml/xmlmemory.h>
147 #include <libxml/xmlerror.h>
148 #include <libxml/tree.h>
150 #include <libxml/uri.h>
151 #include <libxml/xmlsave.h>
152 #include <libxml/xmlunicode.h>
153 #include <libxml/encoding.h>
154 #include <libxml/xmlIO.h>
155 #include <libxml/xmlwriter.h>
156 #include <libxml/xmlreader.h>
157 #include <libxml/xpathInternals.h>
163 using namespace Tizen::Xml;