Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 46
Registered: ‎02-16-2017

WebMap: ExportToGMLService does not escape special characters

If I perform an export to GML, Gfields containing text with special characters like '>' or '<' are not escaped. This results in an invalid gml file.

Any way to fix this without a GWM patch? 

Christian Venzin
Software Engineer
Hexagon Safety & Infrastructure
Highlighted
Staff
Posts: 296
Registered: ‎11-05-2015

Re: WebMap: ExportToGMLService does not escape special characters

Sample code and version info needed, Christian.

 

I've just cobbled together an ExportToGMLService test harness and can't reproduce your issue.

Highlighted
Contributor
Posts: 46
Registered: ‎02-16-2017

Re: WebMap: ExportToGMLService does not escape special characters

Sorry, here is a more detailed explanation (16.00.0200.00004 Professional) :

<gmgml:FeatureCollection xmlns="http://www.intergraph.com/geomedia/gml" xmlns:gml="http://www.opengis.net/gml" xmlns:gmgml="http://www.intergraph.com/geomedia/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberOfFeatures="1">
<gml:boundedBy>
<gml:Box srsName="EPSG:2056">
<gml:coordinates>
2665977.43361443,1206955.36709461 2665977.43361443,1206955.36709461
</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<gml:featureMember>
<gmgml:X_vAbw_Leitung_txt_primaer fid="X_vAbw_Leitung_txt_primaer.83570">
<gmgml:BmAppTooltip/>
<gmgml:X_Txt>
<gmgml:SingleTextPoint srsName="EPSG:2056">
<gml:coordinates>2665977.43361443,1206955.36709461</gml:coordinates>
<gmgml:TextName>350 SB ></gmgml:TextName>
<gmgml:Alignment>0</gmgml:Alignment>
<gmgml:Format>2</gmgml:Format>
<gmgml:Rotation>22.2</gmgml:Rotation>
</gmgml:SingleTextPoint>
</gmgml:X_Txt>
</gmgml:X_vAbw_Leitung_txt_primaer>
</gml:featureMember>
</gmgml:FeatureCollection>
gmlExportService.InputRecordsets = recordsets;
                gmlExportService.GmlVersion = GmlVersion.Gml212;
                gmlExportService.SrsNameAttribute = requestArgs.Projection;
                //gmlExportService.OutputDataTarget = new StreamWrapper(stream);
                gmlExportService.OutputDataTarget = path;
                gmlExportService.Execute();
Christian Venzin
Software Engineer
Hexagon Safety & Infrastructure
Highlighted
Contributor
Posts: 46
Registered: ‎02-16-2017

Re: WebMap: ExportToGMLService does not escape special characters

350 SB > is not escaped. Maybe an issue with SingleTextPoints?

Christian Venzin
Software Engineer
Hexagon Safety & Infrastructure
Highlighted
Contributor
Posts: 46
Registered: ‎02-16-2017

Re: WebMap: ExportToGMLService does not escape special characters

Seems like normal Attributes are escaped correctly:

<gmgml:BmAppTooltip>250 PVC &lt;</gmgml:BmAppTooltip>
Christian Venzin
Software Engineer
Hexagon Safety & Infrastructure
Highlighted
Contributor
Posts: 46
Registered: ‎02-16-2017

Re: WebMap: ExportToGMLService does not escape special characters

the html parser of this **bleep** page is broken and makes posting a pain
Christian Venzin
Software Engineer
Hexagon Safety & Infrastructure
Highlighted
Contributor
Posts: 46
Registered: ‎02-16-2017

Re: WebMap: ExportToGMLService does not escape special characters

Yup, to sum it up: GFields are escaped correctly The text of SingleTextPoints are not escaped and lead to an invalid gml
Christian Venzin
Software Engineer
Hexagon Safety & Infrastructure
Highlighted
Staff
Posts: 296
Registered: ‎11-05-2015

Re: WebMap: ExportToGMLService does not escape special characters

I can confirm that this is a bug in the ExportToGMLService in that it does not escape the text contained in TextPoint geometries.

Apart from manipulating the TextPoints just before exporting and escaping the text or simply have the text escaped in the warehouse, I can't see a way to work around this problem Smiley Sad