Defect #1153

Catalog CSW filter can be wrong depending on configuration

Added by Blatti Yves over 4 years ago.

Status:NewStart date:10/01/2015
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Affected version:4.0.0


Catalog CSW filter can be wrong (xsd validation fails) depending on configuration:

Example 1:

If the configured catalog has one (and only one) resource type specified, the output filter will contain:


You can see an ogc:Or element containing only one element.

Example 2:

The filter contains a 'top level' ogc:And for any catalog level filter. If it is empy, the ogc:And contains only one element ogc:And.

Reason :

   <xsd:element name="logicOps" type="ogc:LogicOpsType" abstract="true"/>
   <xsd:element name="And" 
   <xsd:element name="Or" 
   <xsd:complexType name="BinaryLogicOpType">
         <xsd:extension base="ogc:LogicOpsType">
            <xsd:choice minOccurs="2" maxOccurs="unbounded">
               <xsd:element ref="ogc:comparisonOps"/>
               <xsd:element ref="ogc:spatialOps"/>
               <xsd:element ref="ogc:logicOps"/>

ogc:And and ocg:or are BinaryLogicOpType and have ton contain at least 2 elements of type : ogc:comparisonOps, ogc:spatialOps or ogc:logicOps

Solution :

Any BinaryLogicOp element (or/and) should be dropped if it only contains one element, and its content should be placed in the direct parent.

Also available in: Atom PDF