I'm trying to read and XML file, and one of my tags is <link></link>. When I use jQuery.find('link').text(), I get an empty string. All the other tags are returning correct text. Also, when I simply alert(inputXML), everything is there and correct:
HTML Code:<?xml version="1.0"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>New Indie Bands</title> <link>http://www.newindiebands.com/indie-bands/</link> <description>New Indie Bands</description> <atom:link href="http://www.newindiebands.com/backlinks.xml" rel="self" type="application/rss+xml" /> <item> <title>Indie Bands</title> <description></description> <link>http://amiestreet.com/user/indiebands/</link> <guid>http://amiestreet.com/user/indiebands/</guid> </item> <item> <title>Indie Bands</title> <description></description> <link>http://www.artslant.com/ny/artists/show/127323-indie-bands</link> <guid>http://www.artslant.com/ny/artists/show/127323-indie-bands</guid> </item> </channel> </rss>Any reason why jQuery wouldn't return anything for a link tag in XML? Any way to fix it without changing the XML?Code:$(inputXML).find('link').each(function() { alert($(this).text()); });


Reply With Quote

Bookmarks