111 QDomNodeList fidNodes = filterElem.elementsByTagName( QStringLiteral(
"FeatureId" ) );
112 QDomNodeList goidNodes = filterElem.elementsByTagName( QStringLiteral(
"GmlObjectId" ) );
113 if ( !fidNodes.isEmpty() )
116 QStringList collectedServerFids;
118 for (
int f = 0; f < fidNodes.size(); f++ )
120 fidElem = fidNodes.at( f ).toElement();
121 if ( !fidElem.hasAttribute( QStringLiteral(
"fid" ) ) )
126 QString serverFid = fidElem.attribute( QStringLiteral(
"fid" ) );
127 if ( serverFid.contains( QLatin1String(
"." ) ) )
129 if ( serverFid.section( QStringLiteral(
"." ), 0, 0 ) !=
typeName )
131 serverFid = serverFid.section( QStringLiteral(
"." ), 1, 1 );
133 collectedServerFids << serverFid;
136 if ( collectedServerFids.isEmpty() )
141 serverFids.append( collectedServerFids );
145 else if ( !goidNodes.isEmpty() )
148 QStringList collectedServerFids;
149 QDomElement goidElem;
150 for (
int f = 0; f < goidNodes.size(); f++ )
152 goidElem = goidNodes.at( f ).toElement();
153 if ( !goidElem.hasAttribute( QStringLiteral(
"id" ) ) && !goidElem.hasAttribute( QStringLiteral(
"gml:id" ) ) )
158 QString serverFid = goidElem.attribute( QStringLiteral(
"id" ) );
159 if ( serverFid.isEmpty() )
160 serverFid = goidElem.attribute( QStringLiteral(
"gml:id" ) );
161 if ( serverFid.contains( QLatin1String(
"." ) ) )
163 if ( serverFid.section( QStringLiteral(
"." ), 0, 0 ) !=
typeName )
165 serverFid = serverFid.section( QStringLiteral(
"." ), 1, 1 );
167 collectedServerFids << serverFid;
170 if ( collectedServerFids.isEmpty() )
175 serverFids.append( collectedServerFids );
179 else if ( filterElem.firstChildElement().tagName() == QLatin1String(
"BBOX" ) )
181 QDomElement bboxElem = filterElem.firstChildElement();
182 QDomElement childElem = bboxElem.firstChildElement();
184 while ( !childElem.isNull() )
186 if ( childElem.tagName() == QLatin1String(
"Box" ) )
190 else if ( childElem.tagName() != QLatin1String(
"PropertyName" ) )
196 childElem = childElem.nextSiblingElement();
203 else if ( filterElem.firstChildElement().tagName() == QLatin1String(
"And" ) &&
204 !filterElem.firstChildElement().firstChildElement( QLatin1String(
"BBOX" ) ).isNull() )
206 int nbChildElem = filterElem.firstChildElement().childNodes().size();
209 QDomElement childFilterElement = filterElem.ownerDocument().createElement( QLatin1String(
"Filter" ) );
210 if ( nbChildElem > 2 )
212 QDomElement childAndElement = filterElem.ownerDocument().createElement( QLatin1String(
"And" ) );
213 childFilterElement.appendChild( childAndElement );
217 QDomElement bboxFilterElement = filterElem.ownerDocument().createElement( QLatin1String(
"Filter" ) );
219 QDomElement childElem = filterElem.firstChildElement().firstChildElement();
220 while ( !childElem.isNull() )
223 if ( childElem.tagName() == QLatin1String(
"BBOX" ) )
226 bboxFilterElement.appendChild( childElem.cloneNode(
true ) );
231 if ( nbChildElem > 2 )
233 childFilterElement.firstChildElement().appendChild( childElem.cloneNode(
true ) );
237 childFilterElement.appendChild( childElem.cloneNode(
true ) );
240 childElem = childElem.nextSiblingElement();
244 QStringList collectedServerFids;
261 if ( !collectedServerFids.isEmpty() )
263 serverFids.append( collectedServerFids );
282 if ( filter->hasParserError() || !filter->parserErrorString().isEmpty() )
287 if ( filter->needsGeometry() )
The Context struct stores the current layer and coordinate transform context.