Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F3998930
testLibXml2.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 9, 1:02 AM
Size
747 B
Mime Type
text/x-c++
Expires
Sat, Jul 11, 1:02 AM (1 d, 6 h)
Engine
blob
Format
Raw Data
Handle
272835
Attached To
rXR Xreate
testLibXml2.cpp
View Options
//
// Created by pgess on 3/28/15.
//
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <gtest/gtest.h>
using namespace std;
TEST(libxml2, ReadXML)
{
char* docname = "project/documentation.fodt" ;
xmlDocPtr doc;
xmlNodePtr cur;
doc = xmlParseFile(docname);
if (doc == NULL ) {
fprintf(stderr,"Document not parsed successfully. \n");
return;
}
cur = xmlDocGetRootElement(doc);
if (cur == NULL) {
fprintf(stderr,"empty document\n");
xmlFreeDoc(doc);
return;
}
cur = cur->xmlChildrenNode;
int count =0;
while (cur != NULL) {
printf("child: %s\n", cur->name);
cur = cur->next;
count ++;
}
ASSERT_EQ(17, count);
}
Event Timeline
Log In to Comment