priya_jde
Member
Hi
I am creating an outbound XML file using business functions 'B0000201- XERCES wrapper'. Everything works well and i have XML file ready.
But i want to add attribute to one of the XML tag in the file, not the root element, but some sub element. I tried to use BSFN 'B0000201 - Add XML Attribute XERCES Wrapper', but it did not work.
For e.g. I have a file
<Root>
<Customer>
<Name>ABC</Name>
<Age> 26</Age>
</Customer>
<Transaction>
<Amount Ccy = "EUR">100.50</Amount>
</Transaction>
</Root>
I want to add 'Ccy' attribute to the tag <Amount>, but it is not working. I have used below functions
1. Create XML Document Xerces Wrapper -B0000201 - Create idRootHandle_GENLNG and document element idDocumentElement_GENLNG
2. Create customer tag. not explaining here.
3. Add XML Element String Xerces Wrapper - B0000201 - Create Transaction group. Free element flag = 0, return pointer idTransactionGroup_GENLNG
4. Add XML Element Math Numeric Xerces Wrapper - B0000201 - Create Amount element, free Element Flag = 1, Return pointer idAmount_GENLNG
5. Add XML Attribute Xerces Wrapper - B0000201 -
idRootHandle_GENLNG -> hXMLDocument
idAmount_GENLNG->hElement
'Ccy'->szElementName
#CRCD->szElementValue
But this creates
<Amount>100.50</Amount>
It doesn't add attribute to it.
Please help.
Thanks,
Priya
I am creating an outbound XML file using business functions 'B0000201- XERCES wrapper'. Everything works well and i have XML file ready.
But i want to add attribute to one of the XML tag in the file, not the root element, but some sub element. I tried to use BSFN 'B0000201 - Add XML Attribute XERCES Wrapper', but it did not work.
For e.g. I have a file
<Root>
<Customer>
<Name>ABC</Name>
<Age> 26</Age>
</Customer>
<Transaction>
<Amount Ccy = "EUR">100.50</Amount>
</Transaction>
</Root>
I want to add 'Ccy' attribute to the tag <Amount>, but it is not working. I have used below functions
1. Create XML Document Xerces Wrapper -B0000201 - Create idRootHandle_GENLNG and document element idDocumentElement_GENLNG
2. Create customer tag. not explaining here.
3. Add XML Element String Xerces Wrapper - B0000201 - Create Transaction group. Free element flag = 0, return pointer idTransactionGroup_GENLNG
4. Add XML Element Math Numeric Xerces Wrapper - B0000201 - Create Amount element, free Element Flag = 1, Return pointer idAmount_GENLNG
5. Add XML Attribute Xerces Wrapper - B0000201 -
idRootHandle_GENLNG -> hXMLDocument
idAmount_GENLNG->hElement
'Ccy'->szElementName
#CRCD->szElementValue
But this creates
<Amount>100.50</Amount>
It doesn't add attribute to it.
Please help.
Thanks,
Priya