473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Invalid Name character

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>&#x8A73;&#x7D30;&#x4ED5;&#x69D8;&#x306B;</Name>

code:

strvalue = "&#x8A73;&#x7D30;&#x4ED5;&#x69D8;&#x306B;"

public override void WriteString(string strValue)
{
int intPstn;

if(strValue.IndexOf("&#") != -1)
{
intPstn = 0;

foreach(Match entMatch in rxEnt.Matches(strValue))
{
base.WriteString(strValue.Substring(intPstn, entMatch.Index - intPstn));

try
{
base.WriteEntityRef(entMatch.Value);
}
catch
{
base.WriteString(entMatch.Value);
}

intPstn = entMatch.Index + entMatch.Length;
}

base.WriteString(strValue.Substring(intPstn));
}
else
base.WriteString(strValue);
}


Here the base class is XmlTextWriter.

I am getting an error in base.WriteEntityRef as "Invalid name character in &#x8A73" and please let me know how to resolve it.

Regards,
Vinod
Jul 10 '08 #1
1 3143
jkmyoung
2,057 Expert 2GB
See http://www.w3.org/TR/REC-xml/ particularly the section with NCName and NameChar

NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender

The particular character you're using is not valid for an element name.
Jul 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Safalra | last post by:
The idea here is relatively simple: a java program (I'm using JDK1.4 if that makes a difference) that loads an HTML file, removes invalid characters (or replaces them in the case of common ones...
1
by: aklsdjfh | last post by:
I'm no expert in asp and vbscript but not a total beginner. I've got some VBScript in an asp page which is generating a forumla for use in Lotus Notes replication. The line that it is objecting...
2
by: SHC | last post by:
Hi all, I ran the attached volcanoes.xml (with geology.dtd) in the Module of Access 2003. I got the following error: Microsoft Office Access You have error Invalid Character in content model....
4
by: kevin | last post by:
When I try to select one of the following enums, I see "A name was started with an invalid character." in the tooltip (Intellisence) and under the Summary heading (object browser). Other enums...
3
by: Anders Jansson | last post by:
Hi all. I have 2 problems when I try to open and convert an ASP.NET VS 2003 web-applikation in VS 2005. In VS 2003 I have no problems at all! First: One subfolder with will not be converted!...
3
by: Middletree | last post by:
Teaching myself ASP.NET, using Microsoft Press book called ASP.NET 2.0 by George Shepherd. Ch. 2, it says to type the following code: <%@ Page Language="C#" %> <html>
1
by: Eric | last post by:
When I run my script it gives error on the following line: strEmail = Right(strEmail, (Len(strEmail) - 1)) I enclose my code and the sample text file too Thanks,...
1
by: Eric | last post by:
When I run my script it gives error on the following line: strEmail = Right(strEmail, (Len(strEmail) - 1)) I enclose my code and the sample text file too Thanks,...
4
by: Arpan | last post by:
I am working on Win2K Pro. Due to some problems in IIS5.0, I had to uninstall & re-install IIS. After re-installing IIS, when I try to run any ASPX page (all my ASPX pages reside in...
3
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>
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.