小编aya*_*adi的帖子

JAVA get attributes value from xml using stax parser

I'm working on a project that read RSS feed using java, I use this tutorial they using Stax parser.My question is how I can read attributes values ?

http://www.vogella.com/tutorials/RSSFeed/article.html

This is the RSSReader class,

package de.vogella.rss.read;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.Characters;
import javax.xml.stream.events.XMLEvent;

import de.vogella.rss.model.Feed;
import de.vogella.rss.model.FeedMessage;

public class RSSFeedParser {
    static final String TITLE = "title";
    static final String DESCRIPTION = "description";
    static final String CHANNEL = "channel"; …
Run Code Online (Sandbox Code Playgroud)

java xml rss stax

2
推荐指数
1
解决办法
6361
查看次数

标签 统计

java ×1

rss ×1

stax ×1

xml ×1