473,570 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invalid XML character

Hello,

I'm doing some data manipulation using an XML parser and am getting the
following error message:

Character reference "&#22" is an invalid XML character.

Any thoughts upon what this character could be? I've looked at all instances
of "22" and "#" in the data I've got and can't find any obviously wrong with
any of them.

I'm guessing it's a rogue control character or similar somewhere, but I'd be
grateful if someone could identify what it is I should be looking for!

Thanks in advance,

Mark
Jul 20 '05 #1
5 21987


Mark wrote:
I'm doing some data manipulation using an XML parser and am getting the
following error message:

Character reference "&#22" is an invalid XML character.

Any thoughts upon what this character could be? I've looked at all instances
of "22" and "#" in the data I've got and can't find any obviously wrong with
any of them.

I'm guessing it's a rogue control character or similar somewhere, but I'd be
grateful if someone could identify what it is I should be looking for!


XML 1.0 excludes certain control characters and  is one of those, see
http://www.w3.org/TR/REC-xml/#charsets
This has changed in XML 1.1, see
http://www.w3.org/TR/xml11/#charsets
but so far most parsers only support XML 1.0.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
> XML 1.0 excludes certain control characters and  is one of those, see
http://www.w3.org/TR/REC-xml/#charsets
This has changed in XML 1.1, see
http://www.w3.org/TR/xml11/#charsets
but so far most parsers only support XML 1.0.


I see. Any idea where I could find the ASCII equivalent of &#22? (I need to
amend a script so that this control character is removed whilst I'm
importing this data)

Thanks,

Mark
Jul 20 '05 #3


Mark wrote:
XML 1.0 excludes certain control characters and  is one of those, see
http://www.w3.org/TR/REC-xml/#charsets
This has changed in XML 1.1, see
http://www.w3.org/TR/xml11/#charsets
but so far most parsers only support XML 1.0.

I see. Any idea where I could find the ASCII equivalent of &#22? (I need to
amend a script so that this control character is removed whilst I'm
importing this data)


If you write &#dd; you are using a numeric character reference in XML
where the number is the Unicode of the character. So the Unicode
character with code 22 is what you are looking for and for the codes
0..127 Unicode describes the same characters as ASCII.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #4
> If you write &#dd; you are using a numeric character reference in XML
where the number is the Unicode of the character. So the Unicode
character with code 22 is what you are looking for and for the codes
0..127 Unicode describes the same characters as ASCII.


Thank you very much for your help.

Mark
Jul 20 '05 #5
In article <41************ ***********@new s.easynet.co.uk >,
Mark <ma************ ****@ukonline.c o.uk.nospam> wrote:
Character reference "&#22" is an invalid XML character.

Any thoughts upon what this character could be?


It's control-V, but the message implies that it's appearing as a character
reference ().

My guess is that it's a typo for &#x22; which would be a double quote
character.

-- Richard
Jul 20 '05 #6

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

Similar topics

6
11836
by: cgbusch | last post by:
"Character reference "&#c" is an invalid XML character" With JDOM and Xerces in Java, I get the above error with sequences. I need to be able to encode arbitrary char sequences in xml. any suggestions? -- CB
3
19735
by: Kaidi | last post by:
Hello guys, I get the "an invalid XML character" error when using xerces to parse a XML file. I know that XML will correspond the &, <, >, " to special strings like "&gt;&lt;". However, how about if the XML file really needs to contain some text like: "&#x3;&#x4;&#x14;&#x8;&#x8;"? (as content of a tag) The story is: I am writing a program to...
6
8813
by: Marco Montel | last post by:
I have two applications that should comunicate through an xml file. This xml will contain a CDATA section with a digital signature. The problem is that the digital signature is composed of special character that are nor correctly recognized by the xml parser. When you try to open the follow file with an xml editor, like jedit, you will...
9
8140
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...
3
3728
by: Gabriele Poggi | last post by:
How can I load an xml document, with some invalid character, with the method doc.load(), without exceptions? I have already tried to insert a CDATA Sections in the xml file source, but the result is the same. Thanks.. Gabriele
1
10147
by: King Kong | last post by:
we are facing this kind of error when we double click the infragistic web grid please help me on this Regards Moid Iqbal Server Error in '/NetworkAccess' Application. ---------------------------------------------------------------------------- ----
2
2014
by: none | last post by:
Hi, I'm opening a popup window with JavaScript. It has a command button. This is from the primary source (opener) window: ################################################################### // ======================================================= function popup01 () { var win_url
2
3500
by: sachinik19 | last post by:
Hi, We are using SAXParser (xerces) for parsing an xml with utf-8 encoding. For some special character it gives SAXException with error message - "The invalid character is found in the document ". But for other errors also it gives the same Exception only with different message. Is there any way to detect that the error is because of the...
1
2359
by: =?Utf-8?B?UGF1bCBQaGlsbGlwcw==?= | last post by:
I have read many things about this but I haven't got a clear vision on what to do if anything about this. I have a system that tries to find holes in my web site. One of the things it has found and has been sent to me is an Invalid_Viewstate exception. I will provide the stack trace below. If you read down the stack trace it talks...
1
2794
by: eBob.com | last post by:
I have some code which is trying to determine where text will wrap in a custom text box (which Inherits from Control). It determines the number of characters which will fit in the first line, but then encounters an exception when it calls MeasureCharacterRanges to see if the next character, i.e. the one destined to become the first character...
0
8150
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...
1
7700
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...
0
8000
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...
1
5523
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...
0
3682
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...
0
3671
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
971
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...

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.