[Mono-list] (no subject)

Erik LeBel eriklebel@yahoo.ca
Thu, 27 Feb 2003 11:28:46 -0500 (EST)


--0-1493297886-1046363326=:68546
Content-Type: multipart/alternative; boundary="0-702280723-1046363326=:68546"

--0-702280723-1046363326=:68546
Content-Type: text/plain; charset=us-ascii


Hello folks,

I've put together a patch for XmlTextReader. If this is of any interest to anyone, please feel free to incorporate it.

This patch make the addresses three issues:
- fills thrown XmlException objects with Location information
- verifies that element tags are paired together in a valid fassion
- prevents the apperance of multiple root elements.

I am not running .NET, nor have access to it at the moment. The exceptions that I have added for validation purposes do not conform with the .NET messages. Could somebody check them?

I may continue to dable in the class libraries, if anyone has specific requests or comment/corrections let me know.

cheers,
erik



---------------------------------
Post your free ad now! Yahoo! Canada Personals

--0-702280723-1046363326=:68546
Content-Type: text/html; charset=us-ascii

<P>Hello folks,</P>
<P>I've put together a patch for XmlTextReader. If this is of any interest to anyone, please feel free to incorporate it.</P>
<P>This patch make the addresses three issues:<BR>- fills thrown XmlException objects with Location information<BR>- verifies that element tags are paired together in a valid fassion<BR>- prevents the apperance of multiple root elements.</P>
<P>I am not running .NET, nor have access to it at the moment. The exceptions that I have added for validation purposes do not conform with the .NET messages. Could somebody check them?</P>
<P>I may continue to dable in the class libraries, if anyone has specific requests or comment/corrections let me know.</P>
<P>cheers,<BR>erik</P><p><br><hr size=1>Post your free ad now! <a href="http://ca.personals.yahoo.com/"><b>Yahoo! Canada Personals</b></a><br>
--0-702280723-1046363326=:68546--
--0-1493297886-1046363326=:68546
Content-Type: application/octet-stream; name="XmlTextReader.cs"
Content-Transfer-Encoding: base64
Content-Description: XmlTextReader.cs
Content-Disposition: attachment; filename="XmlTextReader.cs"

Ly8NCi8vIFN5c3RlbS5YbWwuWG1sVGV4dFJlYWRlcg0KLy8NCi8vIEF1dGhv
cjoNCi8vICAgSmFzb24gRGlhbW9uZCAoamFzb25AaW5qZWt0aWxvLm9yZykN
Ci8vICAgQWRhbSBUcmVhdCAobWFueW9zb0B5YWhvby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