Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can we verify if the contents of a file is in xml format or not..?

807589Nov 10 2008 — edited Nov 12 2008
Hi

I am developing a code and am stuck with a part where i have to determine if the contents of a file are in xml format. I want to specify the staement that i have to determine if a file has data in xml format or an ordinary text.

the requirement that i face is to read a file and find if it has content in an xml format irrespective of its extention.
For there can be files havinf .txt extention and havnig contents as in a XML file. i have to read those fiels and process them as a xml files.

Is there any java methjod or API that will help me to fulfill my requirement. Any suggestions will be valuable.

Thanks and Cheers

Phoenix
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 10 2008
Added on Nov 10 2008
10 comments
1,943 views