Hiding XML attribute if no data/value exists
105497May 25 2009 — edited May 26 2009Hi,
I have a xsd set up as following structure:
--------------
<xsd:complexType name="PersonImageType">
<xsd:attribute name="ID" type="xsd:integer"/>
<xsd:attribute name="FileName" type="xsd:string"/>
<xsd:attribute name="ErrorMessage" type="xsd:string" use="optional"/>
<xsd:attribute name="Fetched" type="xsd:string"/>
<xsd:attribute name="S1" type="xsd:string"/>
<xsd:attribute name="S2" type="xsd:string"/>
</xsd:complexType>
--------------
When I execute my BPEL process, I get the response/output as follows:
--------------
<PersonImage>
<PersonImage ID="12410276" FileName="12410276.jpg" ErrorMessage="" Fetched="Y" S1="Y" S2="Y"/>
</PersonImage>
--------------
When you observe the output, the xml attribute 'ErrorMessage' has no value in it.
I would like to :
(a) hide this attribute - when there is no data and
(b) display this attribute - when it holds any data.
Much appreciated if anyone help me to resolve this.
Thanks and Regards,
Rakesh