@@ -523,10 +523,12 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
523
523
QList<int > idxList;
524
524
QgsFields fields = layer->pendingFields ();
525
525
// build corresponding propertyname
526
+ QList<QString> fieldnames;
526
527
QList<QString> propertynames;
527
528
for ( int idx = 0 ; idx < fields.count (); ++idx )
528
529
{
529
- propertynames.append ( fields[idx].name ().replace ( " " , " _" ) );
530
+ fieldnames.append ( fields[idx].name () );
531
+ propertynames.append ( fields[idx].name ().replace ( " " , " _" ).replace ( mConfigParser ->getCleanTagNameRegExp (), " " ) );
530
532
}
531
533
QString fieldName;
532
534
QDomElement propertyElem;
@@ -541,6 +543,10 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
541
543
fieldName = fieldName.section ( " :" , 1 , 1 );
542
544
}
543
545
int fieldNameIdx = propertynames.indexOf ( fieldName );
546
+ if ( fieldNameIdx == -1 )
547
+ {
548
+ fieldNameIdx = fieldnames.indexOf ( fieldName );
549
+ }
544
550
if ( fieldNameIdx > -1 )
545
551
{
546
552
idxList.append ( fieldNameIdx );
@@ -941,16 +947,22 @@ int QgsWFSServer::getFeature( QgsRequestHandler& request, const QString& format
941
947
QList<int > idxList;
942
948
QgsFields fields = layer->pendingFields ();
943
949
// build corresponding propertyname
950
+ QList<QString> fieldnames;
944
951
QList<QString> propertynames;
945
952
for ( int idx = 0 ; idx < fields.count (); ++idx )
946
953
{
947
- propertynames.append ( fields[idx].name ().replace ( " " , " _" ) );
954
+ fieldnames.append ( fields[idx].name () );
955
+ propertynames.append ( fields[idx].name ().replace ( " " , " _" ).replace ( mConfigParser ->getCleanTagNameRegExp (), " " ) );
948
956
}
949
957
QString fieldName;
950
958
for ( alstIt = attrList.begin (); alstIt != attrList.end (); ++alstIt )
951
959
{
952
960
fieldName = *alstIt;
953
961
int fieldNameIdx = propertynames.indexOf ( fieldName );
962
+ if ( fieldNameIdx == -1 )
963
+ {
964
+ fieldNameIdx = fieldnames.indexOf ( fieldName );
965
+ }
954
966
if ( fieldNameIdx > -1 )
955
967
{
956
968
idxList.append ( fieldNameIdx );
@@ -2059,7 +2071,7 @@ QDomElement QgsWFSServer::createFeatureGML2( QgsFeature* feat, QDomDocument& doc
2059
2071
continue ;
2060
2072
}
2061
2073
2062
- QDomElement fieldElem = doc.createElement ( " qgs:" + attributeName.replace ( " " , " _" ) );
2074
+ QDomElement fieldElem = doc.createElement ( " qgs:" + attributeName.replace ( " " , " _" ). replace ( mConfigParser -> getCleanTagNameRegExp (), " " ) );
2063
2075
QDomText fieldText = doc.createTextNode ( featureAttributes[idx].toString () );
2064
2076
fieldElem.appendChild ( fieldText );
2065
2077
typeNameElement.appendChild ( fieldElem );
@@ -2141,7 +2153,7 @@ QDomElement QgsWFSServer::createFeatureGML3( QgsFeature* feat, QDomDocument& doc
2141
2153
continue ;
2142
2154
}
2143
2155
2144
- QDomElement fieldElem = doc.createElement ( " qgs:" + attributeName.replace ( " " , " _" ) );
2156
+ QDomElement fieldElem = doc.createElement ( " qgs:" + attributeName.replace ( " " , " _" ). replace ( mConfigParser -> getCleanTagNameRegExp (), " " ) );
2145
2157
QDomText fieldText = doc.createTextNode ( featureAttributes[idx].toString () );
2146
2158
fieldElem.appendChild ( fieldText );
2147
2159
typeNameElement.appendChild ( fieldElem );
0 commit comments