lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master fd8809d 7/7: Resolve all 'XMLWRAPP !!' marker


From: Greg Chicares
Subject: [lmi-commits] [lmi] master fd8809d 7/7: Resolve all 'XMLWRAPP !!' markers but one
Date: Wed, 27 Mar 2019 11:06:46 -0400 (EDT)

branch: master
commit fd8809dbb3f971367e8cf5a7fc2254870483dc52
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Resolve all 'XMLWRAPP !!' markers but one
---
 xml_lmi_fwd.hpp   | 8 +++++---
 xml_serialize.hpp | 6 +-----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/xml_lmi_fwd.hpp b/xml_lmi_fwd.hpp
index 95772b6..e85b737 100644
--- a/xml_lmi_fwd.hpp
+++ b/xml_lmi_fwd.hpp
@@ -33,9 +33,11 @@ namespace xml // This is xmlwrapp's namespace.
     class schema;
     class tree_parser;
 
-    /// XMLWRAPP !! It is useful to distinguish elements from DOM
-    /// nodes that are not elements; xmlwrapp doesn't make this
-    /// distinction, but a future replacement might.
+    // It would be useful to distinguish elements from DOM nodes that
+    // are not elements; xmlwrapp doesn't make this distinction,
+    // because libxml2 doesn't. See:
+    //   https://lists.nongnu.org/archive/html/lmi/2019-03/msg00048.html
+    // et seqq.
     typedef xml::node element;
 } // namespace xml
 
diff --git a/xml_serialize.hpp b/xml_serialize.hpp
index 5c6e901..cef39da 100644
--- a/xml_serialize.hpp
+++ b/xml_serialize.hpp
@@ -60,11 +60,7 @@ struct xml_io
 
     static void to_xml(xml::element& e, T const& t)
     {
-        e.clear();
-        // XMLWRAPP !! Someday, this might be rewritten thus:
-        //   e.set_content(value_cast<std::string>(t).c_str());
-        // but for now that doesn't work with embedded ampersands.
-        
e.push_back(xml::node(xml::node::text(value_cast<std::string>(t).c_str())));
+        e.set_text_content(value_cast<std::string>(t).c_str());
     }
 
     static void from_xml(xml::element const& e, T& t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]