Parsing non-well formed XML with Qt

后端 未结 2 1094
北荒
北荒 2021-01-25 04:10

I\'d like to use Qt to parse a non-well formed XML document of the form:


//lots of data


//more data


        
相关标签:
2条回答
  • 2021-01-25 04:45

    Create a skeleton document wrapper.xml:

    <!DOCTYPE wrapper [
    <!ENTITY e SYSTEM "real.xml">
    ]>
    <wrapper>&e;</wrapper>
    

    where real.xml is the XML fragment you actually want to read; then point your XML parser at wrapper.xml.

    0 讨论(0)
  • 2021-01-25 04:47

    Just add a <root> before it and a </root> after it, and you have a valid XML document.

    0 讨论(0)
提交回复
热议问题