CMake 3.3.1 XML output fails to parse

Issue #3 resolved
Paul Anton Letnes created an issue

I just observed that if the current version of the plugin is fed CMake 3.3.1 XML it fails to parse. With CMake 3.2.3 XML, it seems to parse just fine.

I will have a look at the differences of the XML and report back.

Comments (10)

  1. Mathieu MARACHE

    It seems that a bug was introduced with the replacement of direct use of cmXMLSafe and std::ostream in favor of cmXMLwriter. cmXMLWriter is wrongly outputing Safe content without (quotes, etc.) escaping.

    I posted this patch to the CMake-developers mailing list to have pre-3.3 area behavior :

    index c38c0de..7b71bae 100644
    --- a/Source/cmXMLWriter.h
    +++ b/Source/cmXMLWriter.h
    @@ -94,12 +94,12 @@ private:
    
       static cmXMLSafe SafeContent(const char* value)
         {
    -    return cmXMLSafe(value).Quotes(false);
    +    return cmXMLSafe(value);
         }
    
       static cmXMLSafe SafeContent(std::string const& value)
         {
    -    return cmXMLSafe(value).Quotes(false);
    +    return cmXMLSafe(value);
         }
    
       template <typename T>
    
  2. Mathieu MARACHE

    I'm putting the issue on-hold till I get an answer from CMake developers. If they don't act on it then I would need to change my code, maybe that the XSL approach recommended in #2

  3. Paul Anton Letnes reporter

    Agree with the approach, we'll manage with CMake 3.2 for now, but it's best to keep up with their new versions as they come along.

  4. Mathieu MARACHE
    • changed status to open

    OK, got a response that quotes in content is valid XML (they were escaped before...). I need to find which part of the parsing packages needs updating or configuring

  5. Log in to comment