• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

An invalid XML character (Unicode: 0x0)

 
bob connolly
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

I'm trying to figure out how to indentify this (0x0 Unicode) character when i encounter it please!

I'm reading a pipe delimited file, parsing it into an array and creating XML and it looks like there is this hidden character at the end of one of the records!

fatalError:
setValidity:
Error number : 1
Error starts on line number : 424
Error starts on column position: 320
Error text is : org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found in the element conte
nt of the document.
HlpValPipBufXml2/Error9/creating SAX parser: org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found in the e
lement content of the document.

Here is where i'm assigning the data to a token and if i could check the array element characters with something like:

j=sa[i].indexOf("0x0");
if (j>0) sa[i].charAt(j)=' ';



Thanks very much!
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unicode: 0x0 is 'null'
What if you test for null in your input and ignore it when found.
 
bob connolly
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh that's the NULL symbol!

Thanks Marylin!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic