summaryrefslogtreecommitdiff
path: root/src/pugixml.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-10-18 18:27:13 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-10-18 18:27:13 +0000
commitd8c19b201f93dc070fb37472f933b53e49b393bc (patch)
treed03dea0fda328120612218413c8aa4526bb75734 /src/pugixml.cpp
parent498947c71897bfad865d37252df6689c1a78e1d8 (diff)
Added xml_document::document_element function
git-svn-id: http://pugixml.googlecode.com/svn/trunk@768 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r--src/pugixml.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 1142930..f53ce1d 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -4595,6 +4595,15 @@ namespace pugi
return true;
}
+ xml_node xml_document::document_element() const
+ {
+ for (xml_node_struct* i = _root->first_child; i; i = i->next_sibling)
+ if ((i->header & xml_memory_page_type_mask) + 1 == node_element)
+ return xml_node(i);
+
+ return xml_node();
+ }
+
#ifndef PUGIXML_NO_STL
std::string PUGIXML_FUNCTION as_utf8(const wchar_t* str)
{