Opened 16 years ago
Closed 15 years ago
#2617 closed defect (fixed)
GML driver can't parse autotest gml files when built with xerces-3.0.0
Reported by: | Even Rouault | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.0 |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | gml xerces 3 |
Cc: |
Description
When building GDAL against xerces-3.0.0, I discovered that the GML driver couldn't read anymore the test files of the autotest suite. The content of 'localname' in GMLHandler::startElement is always empty.
I finally managed to make it work again by removing "m_poSAXReader->setFeature( XMLString::transcode("http://xml.org/sax/features/namespaces"), false);"
See following patch :
Index: ogr/ogrsf_frmts/gml/gmlreader.cpp =================================================================== --- ogr/ogrsf_frmts/gml/gmlreader.cpp (révision 15548) +++ ogr/ogrsf_frmts/gml/gmlreader.cpp (copie de travail) @@ -188,8 +188,6 @@ #else m_poSAXReader->setFeature( XMLString::transcode("http://xml.org/sax/features/validation"), false); - m_poSAXReader->setFeature( - XMLString::transcode("http://xml.org/sax/features/namespaces"), false); #endif } catch (...)
The patch also works with xerces 2.8 (at least on the ionic_wfs.gml example). But as I don't understand all the subtelties of namespace processing I'm not sure if it's the right fix.
Change History (4)
comment:1 by , 16 years ago
Summary: | GML driver can't parse autotest gml files when built with xerces-3.0.0 → [PATCH] GML driver can't parse autotest gml files when built with xerces-3.0.0 |
---|
comment:2 by , 15 years ago
comment:3 by , 15 years ago
Summary: | [PATCH] GML driver can't parse autotest gml files when built with xerces-3.0.0 → GML driver can't parse autotest gml files when built with xerces-3.0.0 |
---|
comment:4 by , 15 years ago
Milestone: | → 1.6.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in r15773.
Don't ask me *why* this works. It's just derived from empirical testing. I can't explain because it appears that xerces 3 and xerces 2 have the same default values for those options. See http://xerces.apache.org/xerces-c/apiDocs-3/classSAX2XMLReader.html#a597ea87071e1a0aa1288567e4bfd6d7 and http://xerces.apache.org/xerces-c/apiDocs-2/classSAX2XMLReader.html#a597ea87071e1a0aa1288567e4bfd6d7
In fact, after testing again, my patch is not appropriate for xerces 2.8
It causes autotest to fail then with:
With xerces-3.0.0, the patch helps the tests to pass... but it downloads http://www.ordnancesurvey.co.uk/xml/schema/v2/geometry.xsd, which is not desirable