Setting XML attributes
Posted: Tue Jun 07, 2005 9:21 am
I am trying to set the attribute of a tag within the XML writer stage such that the entity data output looks like this:
<livestockInformation>
<species Exception="N">HO</species>
</livestockInformation>
The tag is called 'species', the data is 'HO', and the attribute setting I am trying to accomplish is the 'Exception="N"' bit.
In the transformer stage prior to the XML writer stage I have two columns called 'species' and 'Exception'. Exception is hard-coded to "N". In the column definitions the description of the two fields are respectively:
/livestockInformation/species
/livestockInformation/species/@Exception
This gives the following result:
<livestockInformation>
<species>HO</species>
<species Exception="N"/>
</livestockInformation>
Close, but no banana! Other things I have tried have not worked either.
Anyone out there know how to enter attribute text within a tag using the XML writer stage? (Or am I going to have to write a routine to take the xml output and manually insert the 'Exception="N"' bit!?!)
<livestockInformation>
<species Exception="N">HO</species>
</livestockInformation>
The tag is called 'species', the data is 'HO', and the attribute setting I am trying to accomplish is the 'Exception="N"' bit.
In the transformer stage prior to the XML writer stage I have two columns called 'species' and 'Exception'. Exception is hard-coded to "N". In the column definitions the description of the two fields are respectively:
/livestockInformation/species
/livestockInformation/species/@Exception
This gives the following result:
<livestockInformation>
<species>HO</species>
<species Exception="N"/>
</livestockInformation>
Close, but no banana! Other things I have tried have not worked either.
Anyone out there know how to enter attribute text within a tag using the XML writer stage? (Or am I going to have to write a routine to take the xml output and manually insert the 'Exception="N"' bit!?!)