Skip to content

Fix parsing of XML entities and xs:bool - #21

Open
HelloOO7 wants to merge 3 commits into
craflin:masterfrom
HelloOO7:master
Open

Fix parsing of XML entities and xs:bool#21
HelloOO7 wants to merge 3 commits into
craflin:masterfrom
HelloOO7:master

Conversation

@HelloOO7

Copy link
Copy Markdown
Contributor

This PR fixes 2 issues that I've encountered when parsing VDV 301 schemas:

  • xsdcpp only unescaped XML entities present within attributes, not element text contents. This prevented correct parsing of data such as:
    <StopName>
        <Value>Černý Most &lt;icon type="c_UndergroundB">[B]&lt;/icon></Value>
        <Language>cs</Language>
    </StopName>
    The PR fixes this by calling unescapeString when parsing elements.
  • XSD allows the type xs:bool to be expressed both as text values of true/false and as integer literals 1/0. However, xsdcpp only supported the former (using std::boolalpha). My fix will attempt to use std::boolalpha, and if that fails, retry with std::noboolalpha before declaring the boolean as invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant