?
Solved

Recognise XML and RSS

Posted on 2006-05-18
5
Medium Priority
?
277 Views
Last Modified: 2013-11-23
Hi experts!

    From my understanding, if i pass an inputstream of an url to
javax.xml.DocumentBuilder's parse method, it will throw a "SAXException"
exception if that url does not point to a "valid" xml file, am i correct?

Let's say that url points to a valid xml file, how do i make sure if it is a "valid" RSS file?

thanks!
0
Comment
Question by:fungi8210
  • 3
5 Comments
 
LVL 30

Accepted Solution

by:
Mayank S earned 1000 total points
ID: 16708243
Yes, I guess that is correct. If its a SAXException, it means there is an error in parsing (so the file was probably incorrect in format). If its an IOException, there was an error in reading the file.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16708246
http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/DocumentBuilder.html - check the documentation for the parse (InputStream is) method
0
 

Author Comment

by:fungi8210
ID: 16708598
Thanks, is there any method to validate "rss" file? since a valid xml file does not mean it is a valid rss file right?
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16708922
Seems there is a toolkit for it:

http://www.xmlhack.com/read.php?item=750
0
 
LVL 3

Expert Comment

by:Kanti
ID: 16710394
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month8 days, 12 hours left to enroll

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question