Ticket #2611 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

SLD TextSymbolizer can't deal with xmlns on PropertyName node

Reported by: bartvde Assigned to: tomkralidis
Priority: normal Milestone: 5.2 release
Component: WMS Server Version: 5.0
Severity: normal Keywords:
Cc:

Description

When using:

<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NamedLayer><Name>AAA64</Name><UserStyle><FeatureTypeStyle><Rule><Name>default</Name><TextSymbolizer><Label><ogc:PropertyName xmlns:ogc="http://www.opengis.net/ogc">ROUTE</ogc:PropertyName></Label></TextSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>

Mapserver comes back with an error saying that a specified FILTERITEM, CLASSITEM or expression key can't be found.

Leaving out the xmlns:ogc part on the node fixes the problem, but the first case should also be dealt with.

Attachments

ticket2611.patch (0.6 kB) - added by bartvde on 05/08/08 05:30:53.
patch fixing the issue

Change History

05/08/08 04:43:19 changed by bartvde

Okay, a bit of debugging info:

[Thu May 08 10:41:31 2008] [error] [client 145.50.90.76] 2 ([xmlns:ogc]
[Thu May 08 10:41:31 2008] [error] [client 145.50.90.76] msDBFGetItemIndex(): DBASE file error. Item 'xmlns:ogc' not found.
[Thu May 08 10:41:31 2008] [error] [client 145.50.90.76] msDrawMap(): Image handling error. Failed to draw layer named 'AAA64'.
                        sprintf(szTmp, "[%s]", psTmpNode->psChild->pszValue);
                        pszClassText = msStringConcatenate(pszClassText, szTmp);
                        msDebug("2 %s", pszClassText);

05/08/08 05:30:53 changed by bartvde

  • attachment ticket2611.patch added.

patch fixing the issue

05/08/08 05:32:30 changed by bartvde

  • milestone set to 5.2 release.

05/08/08 08:45:17 changed by tomkralidis

  • status changed from new to assigned.
  • owner changed from mapserverbugs to tomkralidis.

Bart: thanks for the patch. Perhaps we should scan the code in general to make sure that this is not happenning elsewhere (i.e. fetching the attribute instead of the content value)? Maybe we should apply to 5-0 branch as well?

05/08/08 09:19:48 changed by tomkralidis

Working on this. Only occurs in the above code block (Bart: I think your patch may be a bit dated, this code is at line 2518 in trunk).

Bart: can you post a small testcase? I'd like to verify that the fix works against a def without the xmlns:ogc attribute as well. I'll try to cobble one together unless you can post something before that.

05/08/08 09:33:52 changed by bartvde

Hi Tom, my patch was against 5.0.2.

With test case you mean: shapefile, MAP file plus a request?

It can be any shapefile and MAP file, and the request above can easily be changed to match a layer name and column available in your dataset (and to leave out/include the xmlns:ogc bit on PropertyName?).

If you still need a testcase, please tell me and I'll prepare one.

05/08/08 10:10:51 changed by tomkralidis

Fixed in trunk (r7570) and branch-5-0 (r7571). Bart: can you verify and close.

05/08/08 10:12:37 changed by bartvde

  • status changed from assigned to closed.
  • resolution set to fixed.

Tom, looks good, marking as FIXED.

05/08/08 10:19:44 changed by assefa

Scanning the code, there are other few places where the CPLGetXMLValue should be used instead of psChild->pszValue for the same reasons as discussed in this bug. I will do the clean up on those and run the autotest to verify.