Problem with XML output format
Posted: Mon Nov 17, 2008 8:49 am
Hello,
I am new to xml and i have a problem with the xml output format which i have been unable to resolve. I have been trying to use the xml output stage to achieve my end result.
I need the follwoing output format :
<Address1>
<localeData locale ="USA">value</localeData>
</Address1>
I guess this can be achieved by providing the xpath as
Column ------ Xpath expression
locale ---------> /Address1/localeData/@locale
Address1 ---------> /Address1/localeData/text()
For now, the locale field can take the values of USA or a blank, and the address1 field can take on an address value or a blank. When the locale is USA(not a blank which means the record has a valid location address) and the address1 field has an adrress desrciption (not a blank, which means the record has a valid address), the xpath gives me what i require.
From the above xpath expression it will follow that when the locale and the address1 is blank (not a valid address) , the format is going to look like :
<Address1>
<localeData locale =""></localeData>
</Address1>
However, what i need is the following when there's no valid address loctaion .
<Address1>
</Address1>
or <Address1/> (single tag option) which is to say the attribute should not show up.
Is there anyway to code this in DS using the output stage?
I would appreciate any help greatly.
Thanks!
I am new to xml and i have a problem with the xml output format which i have been unable to resolve. I have been trying to use the xml output stage to achieve my end result.
I need the follwoing output format :
<Address1>
<localeData locale ="USA">value</localeData>
</Address1>
I guess this can be achieved by providing the xpath as
Column ------ Xpath expression
locale ---------> /Address1/localeData/@locale
Address1 ---------> /Address1/localeData/text()
For now, the locale field can take the values of USA or a blank, and the address1 field can take on an address value or a blank. When the locale is USA(not a blank which means the record has a valid location address) and the address1 field has an adrress desrciption (not a blank, which means the record has a valid address), the xpath gives me what i require.
From the above xpath expression it will follow that when the locale and the address1 is blank (not a valid address) , the format is going to look like :
<Address1>
<localeData locale =""></localeData>
</Address1>
However, what i need is the following when there's no valid address loctaion .
<Address1>
</Address1>
or <Address1/> (single tag option) which is to say the attribute should not show up.
Is there anyway to code this in DS using the output stage?
I would appreciate any help greatly.
Thanks!