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.
19 * @brief This is the header file for the Tizen::Xml namespace.
21 * This header file contains the introduction of the Tizen::Xml namespace.
34 * @namespace Tizen::Xml
35 * @brief <i> [Deprecated] </i> This namespace contains interfaces to manipulate %XML documents.
37 * @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.
41 * @remarks Include Libxml2 open source library header and use APIs directly without any additional setting.
47 * For more information about using Libxml2 open source library, visit <a href="http://www.xmlsoft.org" target="_blank">http://www.xmlsoft.org</a>
51 // Sample data - map.xml
52 <?xml version="1.0" encoding="ISO-8859-1" ?>
56 <country>United Arab Emirates</country>
57 <capital>Abu Dhabi</capital>
61 <country>Nigeria</country>
62 <capital>Abuja</capital>
66 <country>Ghana</country>
67 <capital>Accra</capital>
71 <country>Pitcairn Islands</country>
72 <capital>Adamstown</capital>
76 // Sample code for XmlSample.h
81 public Tizen::Ui::Controls::Form
89 virtual result OnInitializing(void);
92 // Sample code for XmlSample.cpp
93 #include <libxml/parser.h>
94 #include "XmlSample.h"
96 using namespace Tizen::Base;
99 XmlSample::OnInitializing(void)
101 xmlDocPtr pDocument = null;
102 xmlNodePtr pRoot = null;
103 xmlNodePtr pCurrentElement = null;
105 // Creates a XML document
106 pDocument = xmlParseFile("/Home/map.xml");
107 pRoot = xmlDocGetRootElement(pDocument);
109 for(pCurrentElement = pRoot->children; pCurrentElement; pCurrentElement = pCurrentElement->next)
112 xmlNodePtr pChildElement = null;
114 if(pCurrentElement->type == XML_ELEMENT_NODE)
116 // Gets the <country> element from the <item> element
117 pChildElement = pCurrentElement->children->next;
121 // Gets the content from XML_TEXT_NODE
122 Tizen::Base::Utility::StringUtil::Utf8ToString ((char*)pChildElement->children->content, countryName);
123 AppLog("country : %S\n", countryName.GetPointer());
128 xmlFreeDoc(pDocument);
137 #include <libxml/parser.h>
138 #include <libxml/HTMLparser.h>
139 #include <libxml/parserInternals.h>
140 #include <libxml/SAX.h>
141 #include <libxml/SAX2.h>
142 #include <libxml/xpath.h>
143 #include <libxml/xmlmemory.h>
145 #include <libxml/xmlerror.h>
146 #include <libxml/tree.h>
148 #include <libxml/uri.h>
149 #include <libxml/xmlsave.h>
150 #include <libxml/xmlunicode.h>
151 #include <libxml/encoding.h>
152 #include <libxml/xmlIO.h>
153 #include <libxml/xmlwriter.h>
154 #include <libxml/xmlreader.h>
155 #include <libxml/xpathInternals.h>
161 using namespace Tizen::Xml;