From f1e90a59297a3b41e70011848c6916951c91b7f8 Mon Sep 17 00:00:00 2001 From: HelloOO7 Date: Fri, 21 Aug 2026 19:40:25 +0200 Subject: [PATCH 1/3] Add Visual Studio 2026 build directories to .gitignore. --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9ddfd9c..d041af1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /.vscode /build -/CMakeUserPresets.json \ No newline at end of file +/CMakeUserPresets.json +/.vs +/out From 22e23bb738ee3db5ed48843ccf0670df6c232542 Mon Sep 17 00:00:00 2001 From: HelloOO7 Date: Fri, 21 Aug 2026 19:41:19 +0200 Subject: [PATCH 2/3] Fix non-unescaping of XML entities when parsing element text content. --- src/XmlParser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/XmlParser.cpp b/src/XmlParser.cpp index fda2fdf..0dda87a 100644 --- a/src/XmlParser.cpp +++ b/src/XmlParser.cpp @@ -530,6 +530,7 @@ void parseElement(Context& context, xsdcpp::ElementContext& parentElementContext if (context.pos.pos != start) { std::string text = stripComments(start, context.pos.pos - start); + text = unescapeString(text.c_str(), text.size()); elementContext.info->addText(elementContext.element, context.pos, std::move(text)); } } From 309e78969b8787400812642682cc890786ba44d3 Mon Sep 17 00:00:00 2001 From: HelloOO7 Date: Fri, 21 Aug 2026 19:41:58 +0200 Subject: [PATCH 3/3] Fix parsing values of type xs:bool expressed as numbers (0/1). --- src/XmlParser.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/XmlParser.cpp b/src/XmlParser.cpp index 0dda87a..cdb4a79 100644 --- a/src/XmlParser.cpp +++ b/src/XmlParser.cpp @@ -630,6 +630,25 @@ std::string to_string(size_t val, size_t size, const char* const* values, const return values[val]; } +bool parse_xs_bool(std::stringstream& ss, bool& val) +{ + bool b; + + std::streampos pos = ss.tellg(); + + if (!(ss >> std::boolalpha >> b)) + { + ss.clear(); + ss.seekg(pos); + + if (!(ss >> std::noboolalpha >> b)) + return false; + } + + val = b; + return true; +} + void set_string(std::string* obj, const Position&, std::string&& val) { if (obj->empty()) *obj = std::move(val); else *obj += val; } void set_uint64_t(uint64_t* obj, const Position& pos, std::string&& val) { std::stringstream ss(val); if (!(ss >> *obj)) throw VerificationException(pos, "Expected unsigned 64-bit integer value"); } void set_int64_t(int64_t* obj, const Position& pos, std::string&& val) { std::stringstream ss(val); if (!(ss >> *obj)) throw VerificationException(pos, "Expected 64-bit integer value"); } @@ -639,7 +658,7 @@ void set_uint16_t(uint16_t* obj, const Position& pos, std::string&& val) { std: void set_int16_t(int16_t* obj, const Position& pos, std::string&& val) { std::stringstream ss(val); if (!(ss >> *obj)) throw VerificationException(pos, "Expected 16-bit integer value"); } void set_float(float* obj, const Position& pos, std::string&& val) { std::stringstream ss(val); if (!(ss >> *obj)) throw VerificationException(pos, "Expected single precision floating point value"); } void set_double(double* obj, const Position& pos, std::string&& val) { std::stringstream ss(val); if (!(ss >> *obj)) throw VerificationException(pos, "Expected double precision floating point value"); } -void set_bool(bool* obj, const Position& pos, std::string&& val) { std::stringstream ss(val); if (!(ss >> std::boolalpha >> *obj)) throw VerificationException(pos, "Expected boolean value"); } +void set_bool(bool* obj, const Position& pos, std::string&& val) { std::stringstream ss(val); if (!parse_xs_bool(ss, *obj)) throw VerificationException(pos, "Expected boolean value"); } std::string read_file(const std::string& filePath) {