troubleshooting Question

XML startElement with collection

Avatar of no158
no158 asked on
Web Languages and StandardsJava
37 Comments1 Solution322 ViewsLast Modified:
How would I implement a collection within this function or a different one to collect the title of the feed, its pubDate, and its url?

Main goal here is to have a collection of objects that contains the 3 types of info (title of the feed, its pubDate, and its url) to be able to sort the info by its date so when the data is displayed the information is organized. Not sure if the collection should gather the data here but he seems like the logical place to get the data.

  // This gets called when the parser reaches an element
  public void startElement(String uri, String localName, String qName, Attributes atts) {
            int length = atts.getLength();
            for (int i=0; i<length; i++) {
              String name = atts.getQName(i);
              String value = atts.getValue(i);

              //System.out.println("Starting : " + qName);
              //if(qName == "pubDate")
              //this.qName = qName;
Mick Barry
Java Developer
Join our community to see this answer!
Unlock 1 Answer and 37 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 37 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros