Forums » API discussions » Query regarding API's response XML



I need a little clarification on the XML response.

For example below is the part of the response I get:

<outline text="FT News" type="link" url=""/>
<outline text="ONE News" type="link" url=""/>
<outline text="TEDTalks News and Politics" type="link" url=""/>
<outline text="World News Australia Radio" type="link" url=""/>

Now I'm using SAX parser in JAVA.
In this inside the DefaultHandler class, I'm calling the method:

public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {}

Now here there are 2 variables, localname & qname. Right now I'm using localname to fetch tag names (viz. outline), but both variables are giving the same results as there is no namespace in the response yet.
But sometimes I've seen(not in this case but rarely) the localname comes empty string.

So please suggest should I continue using localname?
Or switch to qname.
Please note that if I use qname & you guys change the format of response XML & add namespaces then my code will not function.

Thank You
Rahul Saini

Hi Rahul,

It looks like you are using the API to deliver a response in OPML format. There is( or should be) a namespace in that response. That is <opml version="1.1" xmlns:podcastSearch= "">

I think the URL is not working right and needs correcting.

The tag you want- "outline" is a standard part of the OPML spec and will not be namespaced.

Also, the API is versioned, so if you continue to use that version you should not have a problem with changes.

As for using qname or localname, I don't really know Java so I'm not in a position to help you choose.

If you're only concern is about the outline tag, that has been fixed for years and I cannot see any reason why we would add a namespace to that tag.

In reply to raul8