Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
4.4.3
-
None
-
Microsoft Visual Studio 2005. Windows 7 64 bit. Virtual Machine (VMFusion on a power MAC).
Description
Here's a small code sample. Assume doc is a QXmlStreamReader in progress of reading, and I'm already started reading the xml document. I'm at the starting element of the very first element of the document:
{{{
if (doc.name() == "WFS_Capabilities")
{
for (QXmlStreamNamespaceDeclarations::iterator it = doc.namespaceDeclarations().begin(); it != doc.namespaceDeclarations().end(); ++it)
}
}}}
This loop is getting called on the root element. Here's an example root element that I'm using:
<WFS_Capabilities xmlns="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-capabilities.xsd" version="1.0.0">
I first tried to pull the values straight from the iterator, but the program crashes when I try to convert the QStringRef->toString(). I even tried to use the isNull() and isEmpty() function checks, but it passes the checks, then the program crashes. The memory underneath QStringRef seems random, and garbage.
Is there any way I can retrieve the namespaces from the xml head element using QXmlStreamReader without the program crashing? Thanks.