Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2092 closed defect (fixed)

libxml2.8.0 namespace prefix issue

Reported by: colivier Owned by: colivier
Priority: medium Milestone: PostGIS 2.0.2
Component: postgis Version: 2.0.x
Keywords: history Cc:

Description

This one use to work with libxml2 2.7x

SELECT 'linestring_1', ST_AsEWKT(ST_GeomFromGML('<gml:LineString><gml:coordinates>1,2 3,4</gml:coordinates></gml:LineString>'));

But don't work anymore with 2.8.0 Removing the ns_prefix string make it work:

SELECT 'linestring_1', ST_AsEWKT(ST_GeomFromGML('<LineString><coordinates>1,2 3,4</coordinates></LineString>'))

Defining a gml namespace uri don't seems to change behaviour.

Issue on both 1.5 and 2.0 branch

Change History (13)

comment:1 by pramsey, 12 years ago

Using this instead of xmlParseMemory seems to get us back to the old behavior

xmldoc = xmlReadMemory(xml, xml_size, "noname.xml", NULL, XML_PARSE_SAX1);

Couldn't find anyway to get the SAX2 parser to do what we wanted.

comment:2 by colivier, 12 years ago

Yeap that do the trick for in_gml, but seems still an issue for in_kml…

comment:3 by pramsey, 12 years ago

The problem is is_kml_namespace (probably is_gml_namespace has similar issues, they just aren't tested as much) testing the name space element, which looks like this:

$11 = {
  next = 0x0, 
  type = XML_NAMESPACE_DECL, 
  href = 0x0, 
  prefix = 0x100a038e0 "kml", 
  _private = 0x0, 
  context = 0x0
}

Note that (a) it exists and (b) is has a null href. The routine expects that if you have an ns element, it's got everything, and that if you don't have one, you can assume none was declared. I guess the old routine stripped the prefixes without populating the name space elements, fun.

comment:5 by robe, 12 years ago

Are you gonna fix this before 2.0.2 or punt to 2.0.3?

comment:6 by pramsey, 12 years ago

It's pretty important but also pretty hard. Let me know if you're not doing it Olivier, and I'll try and figure it before the deadline.

comment:7 by robe, 12 years ago

Milestone: PostGIS 2.0.2PostGIS 2.0.3

sounds like this will have to wait. Too much involved to fix and test.

comment:8 by robe, 12 years ago

Milestone: PostGIS 2.0.3PostGIS 2.0.2

comment:9 by colivier, 12 years ago

Resolution: fixed
Status: newclosed

Fix commited in both 2.0 and trunk branches. Tested with libxml 2.8.0 and 2.7.8.

comment:10 by robe, 12 years ago

pramsey can you test Olivier's changes to see if it fixes your regression issues.

Olivier — you forgot to note the r revision.

Then maybe we can have a release before anyone else tries to sneak in another ticket.

comment:11 by robe, 12 years ago

Keywords: history added

comment:12 by robe, 12 years ago

for the record

2.1 - r10767 2.0 - r10765, r10766

comment:13 by colivier, 12 years ago

Thanks Regina for the revision/history add !

Note: See TracTickets for help on using tickets.