priyaranjan panda

priyaranjan panda

  • NA
  • 14
  • 3.1k

load xml file with particular atribute wise

May 15 2015 3:25 AM
 Please check main xml file present in  below,check once
<ATLAS>
     <TP Version="1.0">
      <Procedure>
                  <Test>
                          <Name>Priyaranjan</Name>
                          <Age>29</Age>
                          <Address>Bangalore</Address>
                  </Test>
 
                  <Test>
                         <Name>Sanjeev</Name>
                        <Age>28</Age>
                       <Address>Hyderabad</Address>
                  </Test>
    </Procedure>
         <History>
                   <A>1</A>
                   <B>2</B>
                   <C>3</C>
        </History>
 
     </TP>
 
    <TP Version="2.0">
        <Procedure>
                   <Test>
                              <Name>Prakash</Name>
                              <Age>29</Age>
                              <Address>Odisha</Address>
                   </Test>
                  <Test>
                             <Name>Swetha</Name>
                             <Age>22</Age>
                            <Address>Hyderabad</Address>
                  </Test>
        </Procedure>
 
 
      <History>
                    <A>11</A>
                    <B>22</B>
                    <C>33</C>
     </History>
 
    </TP>
 
</ATLAS>
 
 
MY REquirement is :
 
This is my xml file.with TP Version 1.0 & 2.0.I am using code for load xml file to dataset
ds.ReadXml(filename);//Filename is the path of xml file.
so its loaded ATLAS,TP,Procedure,Test,History table in dataset not consider about the Tp attribute Version No.
My requirement is i want to load same table but only particular Version related data :
suppose Version=1.0
I want only
<TP Version="1.0">
<Procedure>
<Test>
<Name>Priyaranjan</Name>
<Age>29</Age>
<Address>Bangalore</Address>
</Test>
<Test>
<Name>Sanjeev</Name>
<Age>28</Age>
<Address>Hyderabad</Address>
</Test>
</Procedure>
<History>
<A>1</A>
<B>2</B>
<C>3</C>
</History>
</TP>
 

Answers (3)