diff options
author | julienp@opera.com <julienp@opera.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-13 19:31:27 +0000 |
---|---|---|
committer | julienp@opera.com <julienp@opera.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-13 19:31:27 +0000 |
commit | 73e905dec37c04a6643d17c1ef0b32d3ac477c22 (patch) | |
tree | 3db8643dfb4e6060515e91d663f3a8dbe1394559 | |
parent | 95fc42145e5a8cdb0c7624060bf5bfd298838e19 (diff) | |
download | chromium_src-73e905dec37c04a6643d17c1ef0b32d3ac477c22.zip chromium_src-73e905dec37c04a6643d17c1ef0b32d3ac477c22.tar.gz chromium_src-73e905dec37c04a6643d17c1ef0b32d3ac477c22.tar.bz2 |
Made XmlWriter able to write elements with both attributes and content.
This adds a simple method to XmlWriter for appending content to an
already opened element. The only other way to add content to an element
was to call WriteElement, which doesn't allow adding attributes.
TBR=darin@chromium.org
Review URL: https://chromiumcodereview.appspot.com/22337003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217309 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | third_party/libxml/chromium/libxml_utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/third_party/libxml/chromium/libxml_utils.h b/third_party/libxml/chromium/libxml_utils.h index d230c5d..80d05f6 100644 --- a/third_party/libxml/chromium/libxml_utils.h +++ b/third_party/libxml/chromium/libxml_utils.h @@ -133,6 +133,12 @@ class XmlWriter { return xmlTextWriterEndElement(writer_) >= 0; } + // Appends to the content of the current open element. + bool AppendElementContent(const std::string& content) { + return xmlTextWriterWriteString(writer_, + BAD_CAST content.c_str()) >= 0; + } + // Adds an attribute to the current open element. Returns false on error. bool AddAttribute(const std::string& attribute_name, const std::string& attribute_value) { |