Hi Venkatraman,<br>        <br>              Yes,My requirement is to compait 2 XML Files are same or not.<br>Please help me in this regard.<br><br>Rgds,<br>Prasad<br><br><div class="gmail_quote">On Thu, Jun 4, 2009 at 3:20 PM,  <span dir="ltr">&lt;<a href="mailto:bangpypers-request@python.org">bangpypers-request@python.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Send BangPypers mailing list submissions to<br>
        <a href="mailto:bangpypers@python.org">bangpypers@python.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:bangpypers-request@python.org">bangpypers-request@python.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:bangpypers-owner@python.org">bangpypers-owner@python.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of BangPypers digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. [JOB] UN vacancy for Python Developer (Ashok Hariharan)<br>
   2. Regarding 2 XML Files Comparision using Python (testing123 test)<br>
   3. Re: Regarding 2 XML Files Comparision using Python (Venkatraman S)<br>
   4. Re: Regarding 2 XML Files Comparision using Python (Ruchir Shukla)<br>
   5. Re: Regarding 2 XML Files Comparision using Python<br>
      (Anand Balachandran Pillai)<br>
   6. Re: Regarding 2 XML Files Comparision using Python (Venkatraman S)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 4 Jun 2009 11:59:15 +0300<br>
From: Ashok Hariharan &lt;<a href="mailto:ashok@parliaments.info">ashok@parliaments.info</a>&gt;<br>
To: bangalore python-ug list &lt;<a href="mailto:bangpypers@python.org">bangpypers@python.org</a>&gt;<br>
Subject: [BangPypers] [JOB] UN vacancy for Python Developer<br>
Message-ID:<br>
        &lt;<a href="mailto:a245ea580906040159g1f21d904j34924df6c3d9dfaa@mail.gmail.com">a245ea580906040159g1f21d904j34924df6c3d9dfaa@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
There is a official United Nations vacancy for a python developer in<br>
Nairobi (Kenya).<br>
<br>
Please click the link below for details (you can apply online on the same link).<br>
<br>
&lt;<a href="https://jobs.un.org/Galaxy/Release3/Vacancy/Display_Vac.aspx?lang=1200&amp;VACID=9b6c586f-4cc9-4090-8e20-a81da9c32eb4" target="_blank">https://jobs.un.org/Galaxy/Release3/Vacancy/Display_Vac.aspx?lang=1200&amp;VACID=9b6c586f-4cc9-4090-8e20-a81da9c32eb4</a>&gt;<br>

<br>
Kindly contact me off-list if you need any clarifications or more information.<br>
<br>
regds<br>
<br>
Ashok Hariharan<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 4 Jun 2009 14:59:35 +0530<br>
From: testing123 test &lt;<a href="mailto:swtest123@gmail.com">swtest123@gmail.com</a>&gt;<br>
To: <a href="mailto:bangpypers@python.org">bangpypers@python.org</a><br>
Cc: <a href="mailto:xml-sig@python.org">xml-sig@python.org</a><br>
Subject: [BangPypers] Regarding 2 XML Files Comparision using Python<br>
Message-ID:<br>
        &lt;<a href="mailto:8f7c146d0906040229i2d8a0a46i70a01886d119543d@mail.gmail.com">8f7c146d0906040229i2d8a0a46i70a01886d119543d@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
Hi all,<br>
       I am prasad.I need a help to write a python script to compare two XML<br>
Files.Is there any tutorial.Should we include any library?Please help me How<br>
to start?<br>
<br>
Rgds,<br>
Prasad<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://mail.python.org/pipermail/bangpypers/attachments/20090604/31dceacd/attachment-0001.htm" target="_blank">http://mail.python.org/pipermail/bangpypers/attachments/20090604/31dceacd/attachment-0001.htm</a>&gt;<br>

<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Thu, 4 Jun 2009 15:02:46 +0530<br>
From: Venkatraman S &lt;<a href="mailto:venkat83@gmail.com">venkat83@gmail.com</a>&gt;<br>
To: Bangalore Python Users Group - India &lt;<a href="mailto:bangpypers@python.org">bangpypers@python.org</a>&gt;<br>
Subject: Re: [BangPypers] Regarding 2 XML Files Comparision using<br>
        Python<br>
Message-ID:<br>
        &lt;<a href="mailto:a3b05e8b0906040232u3998a48dkcc2cd8d2d5403469@mail.gmail.com">a3b05e8b0906040232u3998a48dkcc2cd8d2d5403469@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
 On Thu, Jun 4, 2009 at 2:59 PM, testing123 test &lt;<a href="mailto:swtest123@gmail.com">swtest123@gmail.com</a>&gt;wrote:<br>
<br>
&gt;        I am prasad.I need a help to write a python script to compare two<br>
&gt; XML Files.Is there any tutorial.Should we include any library?Please help me<br>
&gt; How to start?<br>
&gt;<br>
<br>
It is a structured document! Please use some basic CS skills.<br>
<br>
-V-<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://mail.python.org/pipermail/bangpypers/attachments/20090604/aefe647d/attachment-0001.htm" target="_blank">http://mail.python.org/pipermail/bangpypers/attachments/20090604/aefe647d/attachment-0001.htm</a>&gt;<br>

<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Thu, 4 Jun 2009 15:07:45 +0530<br>
From: Ruchir Shukla &lt;<a href="mailto:ruchiryshukla@gmail.com">ruchiryshukla@gmail.com</a>&gt;<br>
To: Bangalore Python Users Group - India &lt;<a href="mailto:bangpypers@python.org">bangpypers@python.org</a>&gt;<br>
Subject: Re: [BangPypers] Regarding 2 XML Files Comparision using<br>
        Python<br>
Message-ID:<br>
        &lt;<a href="mailto:a5d829d90906040237m2717dfa6l86611275d54255b6@mail.gmail.com">a5d829d90906040237m2717dfa6l86611275d54255b6@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
import difflib<br>
f=open(&#39;text1.txt&#39;,&#39;rb&#39;)<br>
text1=f.read()<br>
f.close()<br>
f=open(&#39;text2.txt&#39;,&#39;rb&#39;)<br>
text2=f.read()<br>
f.close()<br>
#print text1<br>
#print text2<br>
text1_lines = text1.splitlines(1)<br>
text2_lines = text2.splitlines(1)<br>
d = difflib.HtmlDiff()<br>
<br>
diff = d.make_file(text1_lines, text2_lines)<br>
print diff<br>
<br>
<br>
To find difference this program and  *&quot;difflib&quot;* library can help you<br>
HtmlDiff will return the HTML format of the comparison.<br>
<br>
if u are looking for output in plain text format then following can help<br>
you.<br>
<br>
import difflib<br>
d = difflib.Differ()<br>
diff = d.compare(text1_lines, text2_lines)<br>
<br>
On Thu, Jun 4, 2009 at 2:59 PM, testing123 test &lt;<a href="mailto:swtest123@gmail.com">swtest123@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi all,<br>
&gt;        I am prasad.I need a help to write a python script to compare two<br>
&gt; XML Files.Is there any tutorial.Should we include any library?Please help me<br>
&gt; How to start?<br>
&gt;<br>
&gt; Rgds,<br>
&gt; Prasad<br>
&gt; _______________________________________________<br>
&gt; BangPypers mailing list<br>
&gt; <a href="mailto:BangPypers@python.org">BangPypers@python.org</a><br>
&gt; <a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
--<br>
------------------------------<br>
Thanking You<br>
Ruchir Shukla<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://mail.python.org/pipermail/bangpypers/attachments/20090604/f8905c73/attachment-0001.htm" target="_blank">http://mail.python.org/pipermail/bangpypers/attachments/20090604/f8905c73/attachment-0001.htm</a>&gt;<br>

<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Thu, 4 Jun 2009 15:13:05 +0530<br>
From: Anand Balachandran Pillai &lt;<a href="mailto:abpillai@gmail.com">abpillai@gmail.com</a>&gt;<br>
To: Bangalore Python Users Group - India &lt;<a href="mailto:bangpypers@python.org">bangpypers@python.org</a>&gt;<br>
Subject: Re: [BangPypers] Regarding 2 XML Files Comparision using<br>
        Python<br>
Message-ID:<br>
        &lt;<a href="mailto:8548c5f30906040243m3986dd09t845d58bb6fc92ac5@mail.gmail.com">8548c5f30906040243m3986dd09t845d58bb6fc92ac5@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
On Thu, Jun 4, 2009 at 3:02 PM, Venkatraman S &lt;<a href="mailto:venkat83@gmail.com">venkat83@gmail.com</a>&gt; wrote:<br>
<br>
&gt; On Thu, Jun 4, 2009 at 2:59 PM, testing123 test &lt;<a href="mailto:swtest123@gmail.com">swtest123@gmail.com</a>&gt;wrote:<br>
&gt;<br>
&gt;&gt;        I am prasad.I need a help to write a python script to compare two<br>
&gt;&gt; XML Files.Is there any tutorial.Should we include any library?Please help me<br>
&gt;&gt; How to start?<br>
&gt;<br>
&gt;<br>
 What do you want to do while comparing two XML files ? Do you want to<br>
 validate that both XML files  are the same, i.e result in the same<br>
 DOM ? Or do you want to compare only some top-level elements ?<br>
 Give us the context of the problem.<br>
<br>
 Please don&#39;t CC xml-sig on routine XML programming stuff.<br>
 You will probably get flamed/charred beyond recognition.<br>
<br>
<br>
<br>
<br>
&gt;<br>
&gt;&gt;<br>
&gt; It is a structured document! Please use some basic CS skills.<br>
&gt;<br>
&gt; -V-<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; BangPypers mailing list<br>
&gt; <a href="mailto:BangPypers@python.org">BangPypers@python.org</a><br>
&gt; <a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
--<br>
-Anand<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://mail.python.org/pipermail/bangpypers/attachments/20090604/4f3c6b3a/attachment-0001.htm" target="_blank">http://mail.python.org/pipermail/bangpypers/attachments/20090604/4f3c6b3a/attachment-0001.htm</a>&gt;<br>

<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Thu, 4 Jun 2009 15:20:56 +0530<br>
From: Venkatraman S &lt;<a href="mailto:venkat83@gmail.com">venkat83@gmail.com</a>&gt;<br>
To: Bangalore Python Users Group - India &lt;<a href="mailto:bangpypers@python.org">bangpypers@python.org</a>&gt;<br>
Subject: Re: [BangPypers] Regarding 2 XML Files Comparision using<br>
        Python<br>
Message-ID:<br>
        &lt;<a href="mailto:a3b05e8b0906040250w21955763tfcac950db04eed7c@mail.gmail.com">a3b05e8b0906040250w21955763tfcac950db04eed7c@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
On Thu, Jun 4, 2009 at 3:07 PM, Ruchir Shukla &lt;<a href="mailto:ruchiryshukla@gmail.com">ruchiryshukla@gmail.com</a>&gt;wrote:<br>
<br>
&gt; import difflib<br>
&gt; f=open(&#39;text1.txt&#39;,&#39;rb&#39;)<br>
&gt; text1=f.read()<br>
&gt; f.close()<br>
&gt; f=open(&#39;text2.txt&#39;,&#39;rb&#39;)<br>
&gt; text2=f.read()<br>
&gt; f.close()<br>
&gt; #print text1<br>
&gt; #print text2<br>
&gt; text1_lines = text1.splitlines(1)<br>
&gt; text2_lines = text2.splitlines(1)<br>
&gt; d = difflib.HtmlDiff()<br>
&gt;<br>
&gt; diff = d.make_file(text1_lines, text2_lines)<br>
&gt; print diff<br>
&gt;<br>
&gt;<br>
&gt; To find difference this program and  *&quot;difflib&quot;* library can help you<br>
&gt; HtmlDiff will return the HTML format of the comparison.<br>
&gt;<br>
&gt; if u are looking for output in plain text format then following can help<br>
&gt; you.<br>
&gt;<br>
&gt; import difflib<br>
&gt; d = difflib.Differ()<br>
&gt; diff = d.compare(text1_lines, text2_lines)<br>
&gt;<br>
<br>
<br>
Do NOT spoonfeed! *sigh*<br>
<br>
-V-<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://mail.python.org/pipermail/bangpypers/attachments/20090604/06fbfb95/attachment.htm" target="_blank">http://mail.python.org/pipermail/bangpypers/attachments/20090604/06fbfb95/attachment.htm</a>&gt;<br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
BangPypers mailing list<br>
<a href="mailto:BangPypers@python.org">BangPypers@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/bangpypers" target="_blank">http://mail.python.org/mailman/listinfo/bangpypers</a><br>
<br>
<br>
End of BangPypers Digest, Vol 22, Issue 1<br>
*****************************************<br>
</blockquote></div><br>