473,578 Members | 3,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xmltextreader invalid characters and using RegEx to bypass this

I read some advice given to someone here to use RegEx to get around invalid
XML characters. Goran Djuranovic asked the question in 1-21-2007. The
advice was given by Keith Patrick and Goran replied saying it was working
fine. I'm a beginner in object oriented languages.

I'm interested in getting more information on how to use the RegEx for this

I'm getting an exception error on the read using xmltextreader when the
".value" is text containing characters such as " (meaning inches), ' (meaning
feet), 1/4, 1/2, 3/4, and degrees symbol. All these characters are contained
in double quoted text which is used when describing a legal description of a
parcel of land.

Would anyone's suggestion be to pre-read each character of the xml to
replace these characters with the escape sequence that does not cause the
exception on the xmltextreader .read? Is that what the RegEx would do for

Would you have any sample .net v1.1 you'd be willing to share on how you'd
do this?

Thank you
Apr 26 '07 #1
0 1343

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Ron Brennan | last post by:
Good morning. I would like to use one or more RegExps to validate country names as having the first and last words beginning with an uppercase letter, intermediate words beginning with either uppercase or lowercase, and all other characters being lowercase characters. For example: Turks and Caicos The difficult part is that I want to...
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName> <EmployeeStrength>> 1000</EmployeeStrength> When I do a Xmltextreader.read() and then check the contents of the xml node by...
by: Stephen S Kelley | last post by:
I want to do something like: bool bContinueReading=true; XmlTextReader Reader=new XmlTextReader("file.xml"); while(bContinueReading) { try { Reader.Read(); ...
by: GregMa | last post by:
Does anyone have a good regex expression to replace any invalid filename characters in a string? Those characters are: /, \, :, *, ?, ", <, >, | I have it right now with string.replace for each individual character, but would like to do it all in one step if possible. Here's what I have now: title = title.Replace("?", ""); title =...
by: Jimmy | last post by:
Hello, If I want to check in C# code that if there is a & in my string variable using RegExp, how should I inform RegExp about &-char? Is just &, \&, &amp; or something else? I have strucled with this small issue two days and I still not sure how C# accpets &-char in Regular Expresions. Can anyone help?
by: apiringmvp | last post by:
All, So I am creating a function that gets a short blurb of html from a blog. I would like to retain all html formating and images. The code below works well, with the exception of one issue. My issue: --------------------- When a blog's html has attributes with no quotes i get an exception.
by: Goran Djuranovic | last post by:
Hi all, I ran into a problem where my XMLTextReader fails on .Read() when I have "<" character in one of the attribute's values. What I am trying to do is replace illegal characters ("<", "&" , etc.) with legal stuff ("&lt;", "&amp;", etc.), before I send the XML text to a SQL Server stored procedure. Currently, I am using XMLTextReader and StringWriter...
by: Phil Barber | last post by:
I am using Regex to validate a file name. I have everything I need except I would like the dot(.) in the filename only to appear once. My question is it possible to allow one instance of character but not two or more? example myfile.doc = good My.file.doc = not good if you could give an example of the expression pattern that would most...
by: =?Utf-8?B?Vmlub2Q=?= | last post by:
Hi All, I am facing an issue in the XmlTextWriter class in the dotnet 2.0. This is the sample code Actual XML is like this <Name>詳細仕様に</Name>
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.