Working with Rss 2.0, XmlObjectParser

136 views
Skip to first unread message

Nicolas Siver

unread,
Mar 24, 2013, 3:37:53 AM3/24/13
to google-http...@googlegroups.com
I have several questions.

  1. What annotation for POJO's should I use? (@Key like this Json POJO's? )
  2. I'm trying to get Rss 2.0 Feed without explicitly specified default xml namespace ( url: https://www.guildwars2.com/en-gb/feed/) And I got such XmlNamespaceDictionary
    1. new XmlNamespaceDictionary().set("", "http://purl.org/rss/2.0/").set("content", "http://purl.org/rss/1.0/modules/content/").set("wfw", "http://wellformedweb.org/CommentAPI/").set("dc", "http://purl.org/dc/elements/1.1/").set("atom", "http://www.w3.org/2005/Atom").set("sy", "http://purl.org/rss/1.0/modules/syndication/").set("slash", "http://purl.org/rss/1.0/modules/slash/");
    2. There is error:  java.lang.IllegalArgumentException: invalid XML: no alias declared for namesapce <>; work-around by setting XML namepace directly by calling the set method of com.google.api.client.xml.XmlNamespaceDictionary

Yaniv Inbar (יניב ענבר)

unread,
Mar 26, 2013, 8:24:48 AM3/26/13
to google-http...@googlegroups.com
On Sun, Mar 24, 2013 at 3:37 AM, Nicolas Siver <proni...@gmail.com> wrote:
I have several questions.

  1. What annotation for POJO's should I use? (@Key like this Json POJO's? )
Yes. 
  1. I'm trying to get Rss 2.0 Feed without explicitly specified default xml namespace ( url: https://www.guildwars2.com/en-gb/feed/) And I got such XmlNamespaceDictionary
    1. new XmlNamespaceDictionary().set("", "http://purl.org/rss/2.0/").set("content", "http://purl.org/rss/1.0/modules/content/").set("wfw", "http://wellformedweb.org/CommentAPI/").set("dc", "http://purl.org/dc/elements/1.1/").set("atom", "http://www.w3.org/2005/Atom").set("sy", "http://purl.org/rss/1.0/modules/syndication/").set("slash", "http://purl.org/rss/1.0/modules/slash/");
    2. There is error:  java.lang.IllegalArgumentException: invalid XML: no alias declared for namesapce <>; work-around by setting XML namepace directly by calling the set method of com.google.api.client.xml.XmlNamespaceDictionary

Yeah, you have to set the default namespace because it is not defined in the RSS feed.  See also:

-- Yaniv

--
You received this message because you are subscribed to the Google Groups "google-http-java-client" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-http-java-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nicolas Siver

unread,
Mar 28, 2013, 9:44:34 AM3/28/13
to google-http...@googlegroups.com

Yeah, you have to set the default namespace because it is not defined in the RSS feed

Should I wait for implementation of feature? Or how can I add default namespace? 
Such workaround doesn't help:
new XmlNamespaceDictionary().set("", "http://purl.org/rss/2.0/").set …

Guangyu Suo

unread,
Jun 22, 2013, 1:04:28 AM6/22/13
to google-http...@googlegroups.com
Hello, Nicolas

Did you solve this problem ? If you did, can you tell me how to do it ? Because I have the same issue, and have no idea how to solve it, thank you !
Reply all
Reply to author
Forward
0 new messages