Parse XML file on Linux faled because of special characters

P

pavel.orehov

Hi,

I have some web application (.war) which reads XML files on
initialialization. When I run this application on Tomcat on Widows
everything works file. However, when I run it on Tomcat on Linux/
Solaris my application can't parse an XML file, with standart DOM
parser, because it contains special characters created in the file
'^M'. Only after I remove these characters from XML file manually with
VI editor my application is able to parse an XML file.

I suppose it is a common issue and looking for the way to solve it in
a common way.

Thanks,
Pavel
 
A

Arne Vajhøj

I have some web application (.war) which reads XML files on
initialialization. When I run this application on Tomcat on Widows
everything works file. However, when I run it on Tomcat on Linux/
Solaris my application can't parse an XML file, with standart DOM
parser, because it contains special characters created in the file
'^M'. Only after I remove these characters from XML file manually with
VI editor my application is able to parse an XML file.

I suppose it is a common issue and looking for the way to solve it in
a common way.

Move the XML files from Windows to Linux as text files and
not as binary files.

Then you will not have the extra CR's.

Arne
 
M

Martin Gregorie

Arne said:
Move the XML files from Windows to Linux as text files and
not as binary files.

Then you will not have the extra CR's.
Or run them through the dos2unix utility after moving them. Its a
standard program and pretty fast.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top