checking if optional xml element is present
Posted: Thu Apr 25, 2013 7:11 am
Hello!
I have the following xml element defined in the schema:
I have a problem identifying if the xml input data contains the optional element <accountNumber> or not. Unfortunately I do not have the xsd schema available when I register the dataset for the template - so only the xml is registered. I tried using the condition
but it does not work. Is there any other way to check if the optional element is present, or is it mandatory to register the xsd schema too?
Thank you for the reply.
Jozef
I have the following xml element defined in the schema:
Code: Select all
<xs:element minOccurs="0" maxOccurs="1" name="specificMetadata">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="1">
<xs:element minOccurs="0" maxOccurs="1" name="customerNumber" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="accountNumber" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="customerTextual" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
Code: Select all
specificMetadata["accountNumber"] == DBNull.Value
Thank you for the reply.
Jozef