Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Adding body element and removing some other elements

$
0
0

Hi

I am using DataSet.WriteToXML() to get the xml file, the output is as follows:

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<temp>
<temp>
<Reference>S1002</Reference>
<CHID>1100</CHID>
<Number>1</Number>
<ItmCnt>31</ItmCnt>
<val>920617</val>
<cc>bpp</cc>
</temp>

<mob>
<BI>r1</BI>
<CdtDbtInd>C</CdtDbtInd>
<Amt>200000</Amt>
</mob>

<mob>
<BI>r2</BI>
<CdtDbtInd>C</CdtDbtInd>
<Amt>100000</Amt>
</mob>

</temp>

But I want it to be as :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<body>

<temp>
    <Reference>S1002</Reference>
    <CHID>1100</CHID>
    <Number>1</Number>
    <ItmCnt>31</ItmCnt>
    <val>920617</val>
    <cc>bpp</cc>

<mob>
   <BI>r1</BI>
   <CdtDbtInd>C</CdtDbtInd>
   <Amt>200000</Amt>
</mob>

<mob>
   <BI>r2</BI>
   <CdtDbtInd>C</CdtDbtInd>
   <Amt>100000</Amt>
</mob>

</temp>

</body>

How can I remove the first<temp> tag and the <body></body> tag as above?

Really appreciate for helps...


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>