Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#2611 closed defect (fixed)

SLD TextSymbolizer can't deal with xmlns on PropertyName node

Reported by: bartvde Owned by: 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 (1)

ticket2611.patch (594 bytes ) - added by bartvde 16 years ago.
patch fixing the issue

Download all attachments as: .zip

Change History (9)

comment:1 by bartvde, 16 years ago

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);

by bartvde, 16 years ago

Attachment: ticket2611.patch added

patch fixing the issue

comment:2 by bartvde, 16 years ago

Milestone: 5.2 release

comment:3 by tomkralidis, 16 years ago

Owner: changed from mapserverbugs to tomkralidis
Status: newassigned

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?

comment:4 by tomkralidis, 16 years ago

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.

comment:5 by bartvde, 16 years ago

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.

comment:6 by tomkralidis, 16 years ago

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

comment:7 by bartvde, 16 years ago

Resolution: fixed
Status: assignedclosed

Tom, looks good, marking as FIXED.

comment:8 by assefa, 16 years ago

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.

Note: See TracTickets for help on using tickets.