Click here to Skip to main content
15,884,933 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
<billgroup notbill="false" srvcdvr="1702001" totalamount="0.00" usercode="" verified="true">
 <service billdatarequired="true" code="1702" consumernamelength="45" department="Limited" name="Mobile Bill" notbill="false" partpayrange="B" partialpayment="true" version="1">
  <parameter code="2181932" combinationkeyorder="1" datatype="8" displayfield="Y" dynamicfield="" fieldsize="10" iscombinationkey="true" isconsumerkey="false" name="Bill Number" />
  <parameter code="2181929" combinationkeyorder="2" datatype="9" displayfield="Y" dynamicfield="" fieldsize="10" iscombinationkey="true" isconsumerkey="false" name="Bill date" />
  <parameter code="2181936" consumerkeyorder="1" datatype="8" displayfield="" dynamicfield="" fieldsize="12" iscombinationkey="false" isconsumerkey="true" name="Phone Number" />
  <parameter code="2181930" datatype="9" displayfield="" dynamicfield="" fieldsize="10" iscombinationkey="false" isconsumerkey="false" name="Due Date(Cash)" />
  <parameter code="2181939" datatype="9" displayfield="" dynamicfield="" fieldsize="10" iscombinationkey="false" isconsumerkey="false" name="Due Date(Cheq)" />
  <parameter code="2181931" datatype="8" displayfield="" dynamicfield="" fieldsize="10" iscombinationkey="false" isconsumerkey="false" name="Amount before Due Date" />
  <parameter code="2181935" datatype="8" displayfield="" dynamicfield="" fieldsize="10" iscombinationkey="false" isconsumerkey="false" name="Amount (After Due Date)" />
  <parameter code="2181938" datatype="8" displayfield="" dynamicfield="" fieldsize="45" iscombinationkey="false" isconsumerkey="false" name="Consumer Name" />
  <parameter code="2181937" datatype="8" displayfield="" dynamicfield="" fieldsize="10" iscombinationkey="false" isconsumerkey="false" name="Exchange Code" />
  <parameter code="2181928" datatype="8" displayfield="" dynamicfield="" fieldsize="50" iscombinationkey="false" isconsumerkey="false" name="Address 1" />
  <parameter code="2181934" datatype="8" displayfield="" dynamicfield="" fieldsize="50" iscombinationkey="false" isconsumerkey="false" name="Address 2" />
  <parameter code="2181933" datatype="8" displayfield="" dynamicfield="" fieldsize="50" iscombinationkey="false" isconsumerkey="false" name="Account Number" />
  <revenue amount="0.00" code="1" displayable="true" iscomm="N" name="Telephone Bill Charges" variable="true" />
 </service>
 <bill addedtosc="false" afterduedtallowed="true" combinationkey="132456-21 JUN 2015" consumerkey="1234567890" districtcode="34" nodetails="false" notbill="false" paid="false" paidamounthistory="0.00" paymentamount="10.00" servicecode="1702" subscribed="false" tehsilcode="" version="1" villagecode="">
  <parameter code="2181932" value="132456" />
  <parameter code="2181929" value="21 JUN 2015" />
  <parameter code="2181936" value="1234567890" />
  <parameter code="2181930" value="30-06-2015" />
  <parameter code="2181939" value="30-06-2015" />
  <parameter code="2181931" value="10" />
  <parameter code="2181935" value="10" />
  <parameter code="2181938" value="1234567890" />
  <parameter code="2181937" value="ABC" />
  <parameter code="2181928" value="" />
  <parameter code="2181934" value="" />
  <parameter code="2181933" value="123" />
 </bill>
</billgroup>
<code>
</code>


above is my xml i want to extract the values from above xml ?
Posted
Updated 17-Sep-15 11:33am
v5
Comments
Richard Deeming 17-Sep-15 11:32am    
Go ahead - you have our permission to do so.

If you want anyone to help you extract the values, you'll need to tell us what values you want to extract, what you've tried, and where you're stuck.

If you're expecting someone to write your code for you, you've come to the wrong place.
Patrice T 17-Sep-15 12:17pm    
ditto
Naveen_Singh 22-Sep-15 6:03am    
Actually :-

<parameter code="2181932" value="132456" />
<parameter code="2181929" value="21 JUN 2015" />
<parameter code="2181936" value="1234567890" />

tag name is same but i want from these tags .
F-ES Sitecore 17-Sep-15 12:00pm    
Look at XmlDocument, SelectSingleNode, SelectNodes and xpath notation.

.NET FCL offers different ways to parse XML. This is my short overview of them:
  1. Use System.Xml.XmlDocument class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx.
  2. Use the class System.Xml.XmlTextReader; this is the fastest way of reading, especially is you need to skip some data.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx.
  3. Use the class System.Xml.Linq.XDocument; this is the most adequate way similar to that of XmlDocument, supporting LINQ to XML Programming.
    See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx, http://msdn.microsoft.com/en-us/library/bb387063.aspx.

—SA
 
Share this answer
 
Comments
Wendelius 19-Sep-15 1:58am    
Nice options!
Sergey Alexandrovich Kryukov 19-Sep-15 2:54am    
Thank you, Mika.
—SA
Solution 1: Hire a real programmer.
Solution 2: DIY, Start working, learning the language.

If you just want code, you, are at the wrong place. We don't do homework.

By the way, you did not even tell which value you want to read, so even someone wanting to do your homework would be unable to do it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900