Permalink
Browse files

Correctly perform get_text() on <xmltext> nodes.

  • Loading branch information...
1 parent c709f17 commit 7a967d704786cfc94a3f6079902d220e539a16bc @herm herm committed Jul 4, 2012
Showing with 13 additions and 1 deletion.
  1. +1 −0 include/mapnik/xml_tree.hpp
  2. +12 −1 src/xml_tree.cpp
@@ -50,6 +50,7 @@ class xml_tree
void set_filename(std::string fn);
std::string const& filename() const;
xml_node &root();
+ xml_node const& root() const;
private:
xml_node node_;
std::string file_;
View
@@ -193,6 +193,11 @@ xml_node &xml_tree::root()
return node_;
}
+const xml_node &xml_tree::root() const
+{
+ return node_;
+}
+
/****************************************************************************/
xml_attribute::xml_attribute(std::string const& value_)
: value(value_), processed(false)
@@ -423,7 +428,13 @@ std::string xml_node::get_text() const
{
if (children_.size() == 0)
{
- return "";
+ if (is_text_)
+ {
+ return name_;
+ } else
+ {
+ return "";
+ }
}
if (children_.size() == 1)
{

0 comments on commit 7a967d7

Please sign in to comment.