Using Java, is there a way to look at some content, say, String representation of a file and either confirm or deny that it represents an XML file?
What library would you chose to parse the file? Could you possibly provide an example?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
IMO the quickest way would be to see if it parses, particularly if you have a DTD/XSD. You can check for well-formedness without either using any of the normal XML parsing libs.
Otherwise, not really sure what you could do.