tag:blogger.com,1999:blog-16066329573149317372012-06-29T15:35:49.012+05:30C Sharp It With LibinLibin Josehttp://www.blogger.com/profile/03016562244720381378noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-1606632957314931737.post-60091791744724281452012-06-28T19:02:00.002+05:302012-06-29T12:04:40.349+05:302012-06-29T12:04:40.349+05:30Manipulating XML with C#<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
<div style="text-align: justify;">
Here i am going to demonstrate how to parse through XML documents and iterate the node values and names in simple steps.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<strong><em>Step 1: Add the required name spaces</em></strong></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
using System.Xml;</div>
<div style="text-align: justify;">
using System.Xml.XPath; </div>
<div style="text-align: justify;">
System.Xml contains classes related to Xml reading and writing and System.Xml.XPath namespace contains the classes that define a cursor model for navigating and editing XML information items as instances of the XQuery 1.0 and XPath 2.0 Data Model.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<strong><em>Step2:Create a XMLText Reader and load the XML Document</em></strong></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
XML Text reader provides a fast , non cashed forward only access to XML data where as XML Document object can be used to load an XML formated file.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<strong><em>Step 3 :Create an XML Node List and iterate the values.</em></strong></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Upon running the code you can see that the values got populated to the array list from the xml.</div>
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-4Ns3A_EQHpk/T-xYPZazuAI/AAAAAAAAAOI/7kVIAcKnqEQ/s1600/XML.JPG" imageanchor="1" style="clear: left; cssfloat: left; height: 227px; margin-bottom: 1em; margin-left: auto; margin-right: auto; width: 572px;"><img alt="" border="0" height="452" src="http://1.bp.blogspot.com/-4Ns3A_EQHpk/T-xYPZazuAI/AAAAAAAAAOI/7kVIAcKnqEQ/s640/XML.JPG" title="XML Config File" vca="true" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">XML Config File</td></tr>
</tbody></table>
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/-0LzTmnLaU4o/T-xbjgk-coI/AAAAAAAAAOU/dOdf4SovApQ/s1600/Code.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="152" src="http://1.bp.blogspot.com/-0LzTmnLaU4o/T-xbjgk-coI/AAAAAAAAAOU/dOdf4SovApQ/s640/Code.JPG" vca="true" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Code block</td></tr>
</tbody></table>
<div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;">
<br />
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-8ufpEoJ3jy0/T-xccqLMthI/AAAAAAAAAOc/r-NoUIhsDgA/s1600/Values.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="220" src="http://4.bp.blogspot.com/-8ufpEoJ3jy0/T-xccqLMthI/AAAAAAAAAOc/r-NoUIhsDgA/s640/Values.JPG" vca="true" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Quick watch values</td></tr>
</tbody></table>
</div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1606632957314931737-6009179174472428145?l=libinjosechemperi.blogspot.com' alt='' /></div>Libin Josehttp://www.blogger.com/profile/03016562244720381378noreply@blogger.com0tag:blogger.com,1999:blog-1606632957314931737.post-34670359223303781142010-02-17T21:47:00.000+05:302010-02-17T21:48:05.045+05:302010-02-17T21:48:05.045+05:30USIND ADDONS FOR MONITORING BSNL BB USAGEDatafox – BSNL BB usage monitor Addon for Firefox<br /><br /><br />DataFox is a bandwidth usage monitor for BSNL DataOne and MTNL TriBand. It is a cross platform extension written for Firefox that shows data usage statistics on the Firefox status bar. It’s an absolutely great add-on for BSNL BB user<br />If you’re using Firefox, click here to install the extension directly<br />https://addons.mozilla.org/en-US/firefox/addon/5471<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1606632957314931737-3467035922330378114?l=libinjosechemperi.blogspot.com' alt='' /></div>Libin Josehttp://www.blogger.com/profile/03016562244720381378noreply@blogger.com0tag:blogger.com,1999:blog-1606632957314931737.post-26772574730186687712010-02-17T21:32:00.001+05:302010-02-17T21:32:36.923+05:302010-02-17T21:32:36.923+05:30RUNNING LEX AND YACC IN WINDOWS XP<div><<<>>></div><div><br /></div><div>To begin with, you must download the files below first(around 400KB in total). All the files should be in the same directory(flex.exe is standalone but bison.exe is not).</div><div><br /></div><div>http://www.monmouth.com/~wstreett/lex-yacc/flex.exe</div><div><br /></div><div>http://www.monmouth.com/~wstreett/lex-yacc/bison.exe</div><div><br /></div><div>http://www.monmouth.com/~wstreett/lex-yacc/bison.hairy </div><div>http://www.monmouth.com/~wstreett/lex-yacc/bison.simple</div><div><br /></div><div>Another requirement is that you must have a c/c++ compiler(like Turbo C++ ) installed in your system. I believe everyone who has reached compiler level programming will have a c/c++ compiler installed in their system(duh!).</div><div><br /></div><div>Now you can start your work.</div><div><br /></div><div>1. Create a lex program and save it(like ‘x.l’ or ‘x.txt’)</div><div><br /></div><div>2. Reach your directory through command prompt.</div><div><br /></div><div>3. Call flex by “flex <filename>” (eg: “flex x.l”)</div><div><br /></div><div>4. If your lex input file doesnt have any errors, a file name “lex.yy.c” will be generated.</div><div><br /></div><div>5. I suggest you rename “lex.yy.c” to some other more sensible name like “lex.c”, because double extensions is not a good idea in windows environment. Move the file to the folder of your compiler.</div><div><br /></div><div>6 . Call the compiler and input lex.c to it (eg: “tcc lex.c”, where tcc is the Turbo C compiler; use any C/C++ compiler you have). If what you have is a more sophisticated environment like visual studio, you have to do the normal procedure to get a program to compile. If you use Turbo C, an object file “lex.obj’ and the executable “lex.exe” will be generated if there are no compilation problems</div><div><br /></div><div>7. Thats it. Now just run lex.exe. Its your lexical analyser.</div><div>For more details Visit https://libinjose.blogspot.com</div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1606632957314931737-2677257473018668771?l=libinjosechemperi.blogspot.com' alt='' /></div>Libin Josehttp://www.blogger.com/profile/03016562244720381378noreply@blogger.com0