@@ -250,15 +250,21 @@ namespace QgsWfs
250
250
QList<int > idxList;
251
251
// build corresponding propertyname
252
252
QList<QString> propertynames;
253
+ QList<QString> fieldnames;
253
254
for ( int idx = 0 ; idx < fields.count (); ++idx )
254
255
{
255
- propertynames.append ( fields.field ( idx ).name ().replace ( ' ' , ' _' ) );
256
+ fieldnames.append ( fields[idx].name () );
257
+ propertynames.append ( fields.field ( idx ).name ().replace ( ' ' , ' _' ).replace ( cleanTagNameRegExp, QLatin1String ( " " ) ) );
256
258
}
257
259
QString fieldName;
258
260
for ( plstIt = propertyList.begin (); plstIt != propertyList.end (); ++plstIt )
259
261
{
260
262
fieldName = *plstIt;
261
263
int fieldNameIdx = propertynames.indexOf ( fieldName );
264
+ if ( fieldNameIdx == -1 )
265
+ {
266
+ fieldNameIdx = fieldnames.indexOf ( fieldName );
267
+ }
262
268
if ( fieldNameIdx > -1 )
263
269
{
264
270
idxList.append ( fieldNameIdx );
@@ -1319,7 +1325,7 @@ namespace QgsWfs
1319
1325
}
1320
1326
QString attributeName = fields.at ( idx ).name ();
1321
1327
1322
- QDomElement fieldElem = doc.createElement ( " qgs:" + attributeName.replace ( ' ' , ' _' ) );
1328
+ QDomElement fieldElem = doc.createElement ( " qgs:" + attributeName.replace ( ' ' , ' _' ). replace ( cleanTagNameRegExp, QLatin1String ( " " ) ) );
1323
1329
QDomText fieldText = doc.createTextNode ( featureAttributes[idx].toString () );
1324
1330
fieldElem.appendChild ( fieldText );
1325
1331
typeNameElement.appendChild ( fieldElem );
@@ -1416,7 +1422,7 @@ namespace QgsWfs
1416
1422
}
1417
1423
QString attributeName = fields.at ( idx ).name ();
1418
1424
1419
- QDomElement fieldElem = doc.createElement ( " qgs:" + attributeName.replace ( ' ' , ' _' ) );
1425
+ QDomElement fieldElem = doc.createElement ( " qgs:" + attributeName.replace ( ' ' , ' _' ). replace ( cleanTagNameRegExp, QLatin1String ( " " ) ) );
1420
1426
QDomText fieldText = doc.createTextNode ( featureAttributes[idx].toString () );
1421
1427
fieldElem.appendChild ( fieldText );
1422
1428
typeNameElement.appendChild ( fieldElem );
0 commit comments