PDA

View Full Version : XML: need a way to parse file with a mixed contents (some script text + XML + etc.)



BreezeUA
13th April 2012, 13:45
"Pure" XML file can be easily parsed with QDomDocument::setContent, but is there a way to read an XML part from a text file?
For example, a file with a structure like (text/xml order doesn't matter):

ScriptCommandsStart "foo"
ScriptCmd1
...
ScriptCmd100500
ScriptCommandsStop "bar"
...
<!-- <?xml version="1.0" purposefully omitted -->
<Item>
<NestedItem element="foo">
<NestedItem element="bar">
</Item>

Is there a simple way to read that XML part into something like QDomDocument?