Welcome Guest! Log in

Topic-icon Question XML filter [if element exists or not]

More
15 May 2015 19:53 #1 by TAOUILI
XML filter [if element exists or not] was created by TAOUILI
Hi,

I have a XML as source in my mapping, for a choice i have 2 elements like :
<xsd:choice>
<xsd:element name="Air" type="tns:AirType"/>
<xsd:element name="Sea" type="tns:SeaType"/>
</xsd:choice>
for the AirType i have :
<xsd:complexType name="AirType">
<xsd:complexContent>
<xsd:sequence>
<xsd:element name="AirField1" type="xsd:string"/>
<xsd:element name="AIrField2" type="xsd:string"/>
...
and for SeaType i have :
<xsd:complexType name="SeaType">
<xsd:complexContent>
<xsd:sequence>
<xsd:element name="SeaField1" type="xsd:string"/>
<xsd:element name="SeaField2" type="xsd:string"/>
...
My question is, how to test if air exists or sea (AirField1 or SeaField1), I tried to xml\inv\air = (<>) null and sometgings like this but it doesn't work.
FYI: when i'm sure that my xml is sea i can test on SeaField1 = a one particular value but with not null it doesn't work.

Thanks in advance.

Please Log in or Create an account to join the conversation.

More
18 May 2015 15:18 #2 by Thomas BLETON
Replied by Thomas BLETON on topic XML filter [if element exists or not]
Hi,
Did you try using "IS NULL" or "IS NOT NULL" ?
I invite you to try it, and open the generated process to understand where the filter takes place.

Please Log in or Create an account to join the conversation.