| Author |
illegal escape charcter error
|
jyothsna ananthula
Ranch Hand
Joined: Jun 02, 2011
Posts: 33
|
|
hi all
please check the following code as illegal escape character.urgent please
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12928
|
|
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.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
jyothsna ananthula
Ranch Hand
Joined: Jun 02, 2011
Posts: 33
|
|
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
Joined: Oct 27, 2005
Posts: 19216
|
|
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.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
jyothsna ananthula
Ranch Hand
Joined: Jun 02, 2011
Posts: 33
|
|
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
Joined: Oct 02, 2003
Posts: 9950
|
|
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...
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
jyothsna ananthula
Ranch Hand
Joined: Jun 02, 2011
Posts: 33
|
|
|
thanks. you are right i got it.
|
 |
 |
|
|
subject: illegal escape charcter error
|
|
|