@@ -419,60 +419,63 @@ void QgsServerProjectParser::serviceCapabilities( QDomElement& parentElement, QD
419
419
420
420
serviceElem.appendChild ( onlineResourceElem );
421
421
422
- // Contact information
423
- QDomElement contactInfoElem = doc.createElement ( " ContactInformation" );
422
+ if ( service.compare ( " WMS" , Qt::CaseInsensitive ) == 0 ) // no contact information in WFS 1.0 and WCS 1.0
423
+ {
424
+ // Contact information
425
+ QDomElement contactInfoElem = doc.createElement ( " ContactInformation" );
424
426
425
- // Contact person primary
426
- QDomElement contactPersonPrimaryElem = doc.createElement ( " ContactPersonPrimary" );
427
+ // Contact person primary
428
+ QDomElement contactPersonPrimaryElem = doc.createElement ( " ContactPersonPrimary" );
427
429
428
- // Contact person
429
- QDomElement contactPersonElem = propertiesElement.firstChildElement ( " WMSContactPerson" );
430
- QString contactPersonString;
431
- if ( !contactPersonElem.isNull () )
432
- {
433
- contactPersonString = contactPersonElem.text ();
434
- }
435
- QDomElement wmsContactPersonElem = doc.createElement ( " ContactPerson" );
436
- QDomText contactPersonText = doc.createTextNode ( contactPersonString );
437
- wmsContactPersonElem.appendChild ( contactPersonText );
438
- contactPersonPrimaryElem.appendChild ( wmsContactPersonElem );
430
+ // Contact person
431
+ QDomElement contactPersonElem = propertiesElement.firstChildElement ( " WMSContactPerson" );
432
+ QString contactPersonString;
433
+ if ( !contactPersonElem.isNull () )
434
+ {
435
+ contactPersonString = contactPersonElem.text ();
436
+ }
437
+ QDomElement wmsContactPersonElem = doc.createElement ( " ContactPerson" );
438
+ QDomText contactPersonText = doc.createTextNode ( contactPersonString );
439
+ wmsContactPersonElem.appendChild ( contactPersonText );
440
+ contactPersonPrimaryElem.appendChild ( wmsContactPersonElem );
439
441
440
442
441
- // Contact organisation
442
- QDomElement contactOrganizationElem = propertiesElement.firstChildElement ( " WMSContactOrganization" );
443
- QString contactOrganizationString;
444
- if ( !contactOrganizationElem.isNull () )
445
- {
446
- contactOrganizationString = contactOrganizationElem.text ();
447
- }
448
- QDomElement wmsContactOrganizationElem = doc.createElement ( " ContactOrganization" );
449
- QDomText contactOrganizationText = doc.createTextNode ( contactOrganizationString );
450
- wmsContactOrganizationElem.appendChild ( contactOrganizationText );
451
- contactPersonPrimaryElem.appendChild ( wmsContactOrganizationElem );
452
- contactInfoElem.appendChild ( contactPersonPrimaryElem );
443
+ // Contact organisation
444
+ QDomElement contactOrganizationElem = propertiesElement.firstChildElement ( " WMSContactOrganization" );
445
+ QString contactOrganizationString;
446
+ if ( !contactOrganizationElem.isNull () )
447
+ {
448
+ contactOrganizationString = contactOrganizationElem.text ();
449
+ }
450
+ QDomElement wmsContactOrganizationElem = doc.createElement ( " ContactOrganization" );
451
+ QDomText contactOrganizationText = doc.createTextNode ( contactOrganizationString );
452
+ wmsContactOrganizationElem.appendChild ( contactOrganizationText );
453
+ contactPersonPrimaryElem.appendChild ( wmsContactOrganizationElem );
454
+ contactInfoElem.appendChild ( contactPersonPrimaryElem );
455
+
456
+ // phone
457
+ QDomElement phoneElem = propertiesElement.firstChildElement ( " WMSContactPhone" );
458
+ if ( !phoneElem.isNull () )
459
+ {
460
+ QDomElement wmsPhoneElem = doc.createElement ( " ContactVoiceTelephone" );
461
+ QDomText wmsPhoneText = doc.createTextNode ( phoneElem.text () );
462
+ wmsPhoneElem.appendChild ( wmsPhoneText );
463
+ contactInfoElem.appendChild ( wmsPhoneElem );
464
+ }
453
465
454
- // phone
455
- QDomElement phoneElem = propertiesElement.firstChildElement ( " WMSContactPhone " );
456
- if ( !phoneElem .isNull () )
457
- {
458
- QDomElement wmsPhoneElem = doc.createElement ( " ContactVoiceTelephone " );
459
- QDomText wmsPhoneText = doc.createTextNode ( phoneElem .text () );
460
- wmsPhoneElem .appendChild ( wmsPhoneText );
461
- contactInfoElem.appendChild ( wmsPhoneElem );
462
- }
466
+ // mail
467
+ QDomElement mailElem = propertiesElement.firstChildElement ( " WMSContactMail " );
468
+ if ( !mailElem .isNull () )
469
+ {
470
+ QDomElement wmsMailElem = doc.createElement ( " ContactElectronicMailAddress " );
471
+ QDomText wmsMailText = doc.createTextNode ( mailElem .text () );
472
+ wmsMailElem .appendChild ( wmsMailText );
473
+ contactInfoElem.appendChild ( wmsMailElem );
474
+ }
463
475
464
- // mail
465
- QDomElement mailElem = propertiesElement.firstChildElement ( " WMSContactMail" );
466
- if ( !mailElem.isNull () )
467
- {
468
- QDomElement wmsMailElem = doc.createElement ( " ContactElectronicMailAddress" );
469
- QDomText wmsMailText = doc.createTextNode ( mailElem.text () );
470
- wmsMailElem.appendChild ( wmsMailText );
471
- contactInfoElem.appendChild ( wmsMailElem );
476
+ serviceElem.appendChild ( contactInfoElem );
472
477
}
473
478
474
- serviceElem.appendChild ( contactInfoElem );
475
-
476
479
// Fees
477
480
QDomElement feesElem = propertiesElement.firstChildElement ( " WMSFees" );
478
481
if ( !feesElem.isNull () )
0 commit comments