#include "services/data_decoder/xml_parser.h"
#include <map>
#include <utility>
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "third_party/libxml/chromium/libxml_utils.h"
#include "third_party/libxml/chromium/xml_reader.h"
namespace data_decoder {
AttributeMap;
NamespaceMap;
namespace {
void ReportError(XmlParser::ParseCallback callback,
const std::string& generic_error,
const std::string& libxml_error) { … }
enum class TextNodeType { … };
bool GetTextFromNode(XmlReader* xml_reader,
std::string* text,
TextNodeType* node_type) { … }
base::Value::Dict CreateTextNode(const std::string& text,
TextNodeType node_type) { … }
base::Value::Dict CreateNewElement(const std::string& name) { … }
base::Value::Dict* AddChildToElement(base::Value::Dict& element,
base::Value::Dict child) { … }
void PopulateNamespaces(base::Value::Dict& node_value, XmlReader* xml_reader) { … }
void PopulateAttributes(base::Value::Dict& node_value, XmlReader* xml_reader) { … }
void CaptureXmlErrors(void* context, const char* message, ...) { … }
}
XmlParser::XmlParser() = default;
XmlParser::~XmlParser() = default;
void XmlParser::Parse(const std::string& xml,
WhitespaceBehavior whitespace_behavior,
ParseCallback callback) { … }
}