2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // 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.
35 * @namespace Tizen::Xml
36 * @brief <i> [Deprecated] </i> This namespace contains interfaces to manipulate %XML documents.
38 * @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.
42 * @remarks Include Libxml2 open source library header and use APIs directly without any additional setting.
48 * For more information about using Libxml2 open source library, visit <a href="http://www.xmlsoft.org" target="_blank">http://www.xmlsoft.org</a>
52 // Sample data - map.xml
53 <?xml version="1.0" encoding="ISO-8859-1" ?>
57 <country>United Arab Emirates</country>
58 <capital>Abu Dhabi</capital>
62 <country>Nigeria</country>
63 <capital>Abuja</capital>
67 <country>Ghana</country>
68 <capital>Accra</capital>
72 <country>Pitcairn Islands</country>
73 <capital>Adamstown</capital>
77 // Sample code for XmlSample.h
82 public Tizen::Ui::Controls::Form
90 virtual result OnInitializing(void);
93 // Sample code for XmlSample.cpp
94 #include <libxml/parser.h>
95 #include "XmlSample.h"
97 using namespace Tizen::Base;
100 XmlSample::OnInitializing(void)
102 xmlDocPtr pDocument = null;
103 xmlNodePtr pRoot = null;
104 xmlNodePtr pCurrentElement = null;
106 // Creates a XML document
107 pDocument = xmlParseFile("/Home/map.xml");
108 pRoot = xmlDocGetRootElement(pDocument);
110 for(pCurrentElement = pRoot->children; pCurrentElement; pCurrentElement = pCurrentElement->next)
113 xmlNodePtr pChildElement = null;
115 if(pCurrentElement->type == XML_ELEMENT_NODE)
117 // Gets the <country> element from the <item> element
118 pChildElement = pCurrentElement->children->next;
122 // Gets the content from XML_TEXT_NODE
123 Tizen::Base::Utility::StringUtil::Utf8ToString ((char*)pChildElement->children->content, countryName);
124 AppLog("country : %S\n", countryName.GetPointer());
129 xmlFreeDoc(pDocument);
138 #include <libxml/parser.h>
139 #include <libxml/HTMLparser.h>
140 #include <libxml/parserInternals.h>
141 #include <libxml/SAX.h>
142 #include <libxml/SAX2.h>
143 #include <libxml/xpath.h>
144 #include <libxml/xmlmemory.h>
146 #include <libxml/xmlerror.h>
147 #include <libxml/tree.h>
149 #include <libxml/uri.h>
150 #include <libxml/xmlsave.h>
151 #include <libxml/xmlunicode.h>
152 #include <libxml/encoding.h>
153 #include <libxml/xmlIO.h>
154 #include <libxml/xmlwriter.h>
155 #include <libxml/xmlreader.h>
156 #include <libxml/xpathInternals.h>
162 using namespace Tizen::Xml;