top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to find Invalid special characters in XML

+1 vote
798 views

We are facing below error while validating XML file using Java utility, below is error message :

An invalid XML character (Unicode: 0x{2}) was found in the value of attribute "{1}" and
element is "1a". 

for validation we have used XMLspy however it has gave up to open file because of its huge size, please suggest how we can find this invalid character.

All ideas are welcomed.

Thanks

posted May 7, 2014 by Madhavi Kumari

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

When the message is actually displayed, {2} and {1} should have been replaced with the Unicode hex value of the character and the the name of the attribute respectively. Those would tell you what to look for and where to look.

For huge documents, you may be better off using SAX-based processing (or one of the other event-driven systems) rather than DOM-based parsing, so you can decide what information needs to be kept, versus what can be processed immediately and/or discarded. If you do need a DOM, you may need to alter your Java configuration to obtain more heap or stack memory; that's typically done with -Xmx and =Xms options.

answer May 9, 2014 by Shweta Singh
Similar Questions
+1 vote

I am facing below error while validating XML file using Java utility, below is error message :

An invalid XML character (Unicode: 0x{2}) was found in the value of attribute "{1}" and element is "1a".

for validation I have used XMLspy however it has gave up to open file because of its huge size, please suggest how we can find this invalid character.

+1 vote

Is there any function to replace the special characters by null in informatica

if we used replacestr function, i think we should specify all special characters

as follows replacestr(input,'!','~','@','#','$','%','^','&','*',null)

But we dont know what are teh special characters will be coming as input.

can u please let me know that which function will be suitable.

+2 votes

What are some of the best ways to build XML in C# code?

...