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>詳細仕様に</Name>

code: 

strvalue = "詳細仕様に"

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

0
Vinod1 (29)
7/10/2008 11:00:01 PM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
828 Views

Similar Articles

[PageSpeed] 53

Vinod wrote:
> 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>
> 
> code: 
> 
> strvalue = "詳細仕様に"
> 
> 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.

What is the value passed to WriteEntityRef?
What do you want to achieve?
If you want to write a character reference to a character then use 
WriteCharEntity e.g.
   writer.WriteCharEntity('a')
if you want to write an entity reference then use WriteEntityRef and 
pass in the name of the entity e.g.
   writer.WriteEntityRef("apos")

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1777)
7/11/2008 11:33:13 AM
Reply:

Similar Artilces:

Referencing worksheet name in formula
I am trying to find an elegant way to refer a worksheet name in an easily copied formula. In this particular example, I have a sequence of month-specific worksheets, eleven of which reference the month prior to bring up YTD figures. I've just become acquainted with the INDIRECT function but that seems a bit cumbersome, as it entails either modifying the cell reference portion of the formula (e.g., =INDIRECT($A$37&"A16")+D16, where $A$37 references the previous month) or requires a reference cell on each sheet for each desired referenced field. I'd like to find a reference...

Invalid File Format
When I start Excel I get an initial message that says ssipro97.dot is an invalid format. Any idea why this would come up? It doesn't seem to affect how Excel works, it's just annoyint. ...

Invalid syntax
I get the error invalid syntax for the following line : ( summing up figures in case GetBonus = Yes) Bonus : iif(getBonus = -1;nz(BonusL1;0)+ NZ([BonusL2];0)+ NZ([BonusL3];0) could you help ? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200712/1 Ditch the semicolons. iif( Formula to test,results if true, results if false.) I would guess you want iif(getBonus = -1,nz(BonusL1;0)+ NZ([BonusL2];0)+ NZ([BonusL3],0) peljo via AccessMonster.com wrote: > I get the error invalid syntax for the following line : ( summing up figures...

Re: Lead Views
Oh, pretty-pretty please, can you make the Company's "Name" column resizable??? I'm looking at this unnecessarily enormous column for the Company's Name, and there's very, very little room to view the data in the other columns. Thanks! ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click ...

invalid handle
hi frds i m very new in vc++ and i m founding too much difficulty in this so plz can any one solve this problem .... actully i m inserting a image in list box using this code ........ everything is returning write thing still it is saying invalid handle after ImageList_Add(hList,m_hBmpNew,0); when i m going to dibug it plz help me BOOL Fun() { // Create 256 color image lists HIMAGELIST hList = ImageList_Create(32,32, ILC_COLOR8 , 8, 1); HBITMAP m_hBmpNew = (HBITMAP) LoadImage( AfxGetInstanceHandle(), // handle to instance "c:\\img.bmp", /...

Invalid Property Value
I have a macro that uses an input form to populate a spreadsheet. There are various validations that run prior to the data populating. On one validation if an incorrect choice has been made from a drop down box a error message prompts the user to select again form the drop down box and will not populate until a valid selection has been made. I am now getting an Excel warning message (exclamation message) saying 'Invalid Property Value' after the spreadsheet has populated which only happens if an invalid selection has been made and corrected from the drop down box. If the ...

Graphics.DrawString character set problem
Hi. I'm using a special font called Maestro, which contains musical symbols. If I use Excel's char() function, I establish that one of the symbols I want has ascii code 206. Then I use DrawString on a WinForm, character 206 (0xCE) displays a completely different character. Indeed, if I display all characters from said font, none of them are the symbol I want - which does display in Excel, so the symbol IS in the font. This is presumably because of my regional settings or such? How can I force a particular code set for Graphics to use?? On 07/12/2009 in message...

OFX
When doing an update from my broker I get the message cannot establish secure communication with the server. Digital certificate is invalid. OFXIE12038. This is new happening in last month. Broker support says problem is Money 2002 not supported so I installed Money 2005 (with some qualms) and of course, still get the same message. I can access the brokerage website OK from Money, just cannot get statement downloads. -- Bill ...

Invalid Procedure Call on Forms
Hello, any suggestions are appreciated! I imported tables from our media database into our membership database. I was going to combine the information so that I could streamline orders with lookup fields but my supervisor didn't like it so... I went back to the media database and now NONE of the form buttons are working. The forms open, and all the reports, queries, and tables open without incident. However, when I click any button on any form (to call up a report, query or another form), I receive an error: "Invalid Procedure Call or Arguement". I tried creating a...

Correct way of changing MFC application name (m_pszAppName)
As far as I understand, the MSDN documentation regarding how to change CWinApp::m_pszAppName is incorrect. Following the documentation can lead to memory access violation errors. Additionally, the KB article 154744 also gives wrong advise about how to change m_pszAppName. Here's why: At the very beginning of application initialization, AfxWinInit calls CWinApp::SetCurrentHandles, which caches the current value of the m_pszAppName pointer as follows: pModuleState->m_lpszCurrentAppName = m_pszAppName; That is, the module state struct holds a copy of the m_pszAppName pointer. Now, if y...

how do I display cell contents when I am over 32, 767 characters?
Excel was not designed for this. Depending on your purpose, you should use Word or Access. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ "usdrmd" <usdrmd@discussions.microsoft.com> wrote in message news:E30267BD-2CAF-4FC7-83A2-F9E79F7CFE06@microsoft.com... > ...

How do you display the sheet name in a cell?
How do you display the sheet name in a cell? =MID(CELL("filename",A1),FIND("]",CELL("filename",A1)) +1,31) Workbook must be saved to work. HTH Jason Atlanta, GA >-----Original Message----- >How do you display the sheet name in a cell? >. > "Jason Morin" wrote: > =MID(CELL("filename",A1),FIND("]",CELL("filename",A1)) > +1,31) > > Workbook must be saved to work. > > HTH > Jason > Atlanta, GA > > >-----Original Message----- > >How do you display the sheet name in a c...

Invalid Operation 425
I know there are a few other threads pretaining to "Invalid Operation 425, Cash Drawer locked by another application" but the solutions given there have not solved our problem. We have multiple store locations with the exact same set-up but only one is having this problem . The problem happens most of the time but not always. Our set up is RMS version 2.0 Printer - Epson Tm-881V Cash Drawer - APG VB320 OPOS ADK 2.6 Running on Windows XP Pro Any body have an idea? -- Many thanks Jack Master Jack - Without taking time to go back against all old posts and see what is liste...

SometimesSenders Name does not appear when posting to a public fol
We are using a Public folder setup with a Moderator. We have noticed that when some senders post something on to the Folder, sender name does not appear. THis is the case with only some users. Instead of the Senders name the moderator gets the public folder name as sender. We using Exchange 2003 with Outlook 2003. Anyone any ideas. This seems to be a bug. As it only happens with some users. ...

Macro to hide worksheet based upon text in the name
Is it possible to have a macro that hides worksheets based upon text contained or not contained in the worksheet name? Suppose i have several worksheets but want to hide ony the ones that don't have the text "HOLD" in the name; worksheet names: Data_HOLD Data Selection_HOLD etc.... or maybe base it upon the WS tab color.... Thanks, Joe M. Hi, This will hide all worksheets with Hold anywhere in the name Sub Hide_shts() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets If InStr(1, ws.Name, "Hold", vbTextCompare) Then ws....

Another Method for Parsing Names
Having bothered others with ways of parsing names, I thought I'd at lease contribute a simple solution for doing the complete job... Assume you have names of the following types in column C Mrs Dorothy Hannity Dr P R Rogers Dana Delany Mr Bradley K Pitts Type the following formulas into the specified cells: O1=FIND(" ",C1) Determines the location/existence of the blank following the Salutaton or First Name P1=FIND(" ",C1,FIND(" ",C1)+1) Determines the location/existence of the blank following the First Name ...

Exchange 2000 mailbox shows another user name other than the owner's name
Hi; When I go to the mailbox in System Manager of Exchange 2000, I found that some mailboxes which are accessed or logged on by another user name. For example; the "Last Logged on By" column for mailbox "Sam" showing logged on by John. I checked the mailbox of Sam, he did not share his mailbox with John. Why it displays like that? I am using Veritas to backup Exchange, but I used a system account to logon mailbox for backup. What is the other factor? Thanks! ...

550 relaying mail to <domain name> is not allowed
I keep getting this message generated by the system administrator when I try sending emails to some email adddresses. Anyone know why and where I can find a fix? John You probably need to authenticate to your outgoing server. You can set this up on the "Outgoing Server" tab for your account. -- Jeff Stephenson Outlook Development This posting is provided "AS IS" with no warranties, and confers no rights "Joh" <jrwalton@talk21.com> wrote in message news:028601c35cc4$222c7470$a001280a@phx.gbl... > I keep getting this message generated by the system...

How to count last name letters
Hi folks, I would like to know how I can count how many records have the same letter. For example, how many records start with the letter A, how many for letter B, etc. Seems simple enough, but I can't figure out how to work this. Would appreciate some help. Thanks. In news:uKD40b2rHHA.3484@TK2MSFTNGP05.phx.gbl, jason <jasonsantos-NOSPAM-@allstatesmedical.com> wrote: > Hi folks, > I would like to know how I can count how many records have the same > letter. For example, how many records start with the letter A, how > many for letter B, etc. > > Seems simple ...

How do I separate a name into 2 columns from Surname, christian n.
I have a list of names in the format "surname, christian name" and want to separate the two names so I have the surname and christian names in different columns. Is there a function formula to do this? Data > Text to Columns > follow the wizard "Phil B" wrote: > I have a list of names in the format "surname, christian name" and want to > separate the two names so I have the surname and christian names in different > columns. Is there a function formula to do this? ...

Named Property Quota Limit
The property names all seem to be generating from a product called PreciseMail Anti-Spam Gateway, part of the PMDF PreciseMail product which we use. Does anyone know how to fix this error permanently besides just expanding the quota limit and/or moving all of the mailboxes in the store to a new store every time the quota limit is reached. Event Type: Error Event Source: MSExchangeIS Event Category: General Event ID: 9667 Date: 2/8/2007 Time: 5:23:15 PM User: N/A Computer: editservername Description: Failed to create a new named property for database "Fourth Storage Group\Mailbox Stor...

Renamed invalid sheet name
I have a routine that opens a workbook to access data and then closes it. It has worked fine for years with XP and Excel 2000. Since changing to Win 7 and Excel 2003 it will no longer automatically open. A warning box appears "Repairs to 'Workbook'" and the message "Renamed invalid sheet name". After closing the message box it renames the worksheet to "Recovered_Sheet 1" and opens the workbook. However, this is a manual process and I need it to be automated as before. What I have found (I believe) is that if the file name includes "...

Invalid object name when I try to create a scaler udf in a stored procedure.
I am trying to create a report that shows a company name, all the advisors in that company, then the company's stats (there should be one row for each company). Each of these come from a different table. The advisors are currently being listed as one per line, which means the company name and the stats are all being repeated unneccesarily. I want to concatinate the advisors, so that all the ones that belong to the same company show in the same cell. I wrote this UDF which is located right before my SP: CREATE FUNCTION [dbo].[ConcatAdvisorNames](@Company as varchar(20)) RETURNS VA...

sheet name
is it possible to refer in a cell to the sheet name? Fanny, See http://www.xldynamic.com/source/xld.xlFAQ0002.html -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "fanny" <f.klompsma@chello.nl> wrote in message news:9e74e$45a7d4b9$3ea34e15$16565@news.chello.nl... > is it possible to refer in a cell to the sheet name? > ...

Friendly Report Names
I have 40+ reports with somewhat critic names that would confuse my users, Is there a way to assign a alias/friendly name to the reports and use it to call the report from a listbox? Thank you for any and all suggestions Gil -- Message posted via http://www.accessmonster.com Steve wrote: >Build a table of report names: >TblReportName >CryticName >UserFriendlyName > >Make this table the Rowsource of your listbox. Set the Bound Column = 1, >Column Count = 2 and Column Width = 0, 3. The listbox will display the user >friendly names but the selec...