473,602 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invalid Name character

7 New Member
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;&#x7D3 0;&#x4ED5;&#x69 D8;&#x306B;"

public override void WriteString(str ing strValue)
{
int intPstn;

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

foreach(Match entMatch in rxEnt.Matches(s trValue))
{
base.WriteStrin g(strValue.Subs tring(intPstn, entMatch.Index - intPstn));

try
{
base.WriteEntit yRef(entMatch.V alue);
}
catch
{
base.WriteStrin g(entMatch.Valu e);
}

intPstn = entMatch.Index + entMatch.Length ;
}

base.WriteStrin g(strValue.Subs tring(intPstn)) ;
}
else
base.WriteStrin g(strValue);
}


Here the base class is XmlTextWriter.

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

Regards,
Vinod
Jul 10 '08 #1
1 3165
jkmyoung
2,057 Recognized Expert Top Contributor
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
8143
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 like Microsoft's 'smartquotes'), and outputs the file. The problem is these files will be on disk, so the program won't have the character encoding information from the server. Questions:
1
7528
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 to is <% if user2 <> "" then response.write("| @IsMember(&quot;" & LCase(user2) & "&quot;;@LowerCase(@Name(;AssignedTo)))") end if %> i.e. if the string user2 is "Mike" I expect the HTML to be |...
2
2074
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. |OK| Please help and advise me what is wrong in my source code and how to correct
4
5018
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 seem to behave normally. I even removed the <remarks/> comment with no change in behavior. When I build I see the following warning for each enum value: warning CS1570: XML comment on 'CreditorMigration.SourceAndDestination.PayerToUs' has badly...
3
2196
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! The converted web project are missing this subfolder completely. 39 errors are displayed in the Conversion Report saying: ERROR: Unable to get local copy of file <file>. Why? All files are there and readable!!
3
4138
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
1783
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, ----------------------------------------------------------------------------- Option Compare Database Option Explicit Private Sub Command26_Click()
1
3201
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, ----------------------------------------------------------------------------- Option Compare Database Option Explicit Private Sub Command26_Click()
4
4704
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 C:\Inetpub\wwwroot\ASPX folder) by typing the following URL in IE6.0 http://myserver/ASPX/MyPage.aspx the following error gets generated: A name was started with an invalid character. Error processing resource
3
3074
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
7920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8401
Oralloy
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8404
jinu1996
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8268
tracyyun
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3900
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1254
bsmnconsultancy
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.