• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

illegal escape charcter error

 
jyothsna ananthula
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

please check the following code as illegal escape character.urgent please
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The backslash \ character in string literals is the escape character. It allows you to write for example \n for a newline, \t for a tab etc.

If you write "C:\Documents and Settings\JA0084604\Desktop\test1a.xml" then Java is going to complain that \D and \J are illegal escape sequences. If you want to include a literal backslash in your string, you have to write \\ (two backslashes).

So, change the string to: "C:\\Documents and Settings\\JA0084604\\Desktop\\test1a.xml"

Please UseCodeTags when you post source code. Also, please EaseUp.
 
jyothsna ananthula
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks alot. i am suffering with since 1 hr.i changed as like that but for only c i did remaining i didnt.

if you know xmldiff classe let me know please.its urgent to me
 
Rob Spoor
Sheriff
Pie
Posts: 20369
43
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jyothsna ananthula wrote:thanks alot.

Where did you see an Alot?

i am suffering with since 1 hr.i changed as like that but for only c i did remaining i didnt.

Please UseRealWords: "hour" and "see" (I think) instead of "hr" and "c".

its urgent to me

Please EaseUp.
 
jyothsna ananthula
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the following code i am getting error at a.setDocuments(xmlDocument1,xmlDocument2); cann't find symbol xmlDocument1 and xmlDocument2




any body help me out please.
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12015
24
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added code tags to your post to make it more legible. Next time, just highlight your code and click the little "code" button above - just like you wanted to make something italic or bold (but don't make your code italic or bold...)

To answer your question...

You declare your XMLDocument inside your try block. therefore, as soon as you go out of the try block the document falls out of scope, and thus doesn't exist anymore. The solution would be to declare them outside the try block, but still assign them inside...something like this:



Note: I didn't actually test/compile this, so i'm not 100% sure i have it correct...
 
jyothsna ananthula
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks. you are right i got it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic