/    Sign up×
Community /Pin to ProfileBookmark

XML – printing out nodes

hi there –

I have an xml feed that I want to printout. I can get all the other nodes – description, pubDate, title, but not category – there are multple categories and I am interested only in populated ones.

I do not control the feed – only consume it.

XML -typical <item>

<item><title type=”text”>Canadian Insurance Companies Effective Tax Rate Study</title><author><name>Mary

O&#39;Connor</name></author><link>http://web.link.com/RESEARCH.NSF/$$WebView/34ED4BB010DE18CA80257B980038DF14</link><updated>2013-07-

06t12:00:00z</updated><description>An effective tax rate study (ETR) compares the components of the ETR and deferred tax items of several

companies. The attached ETR compares Canadian insurers </description><pubDate>2013-06-28t12:00:00z</pubDate>
<category>Insurance</category>
<category>Client Insight</category>
<category>Market Insight</category>
<category></category>
<category></category>
<category></category>
<category></category>
<category>Canada</category>
<category></category>
<category>Global Research and Analysis</category>
<category>2013-07-06t12:00:00z</category>
<category>2013-06-28t12:00:00z</category>
<category></category>
<category>2013-06-28t12:00:00z</category>
<category></category></item>

I am using this to output:

if(items.getElementsByTagName(‘item’)[i].getElementsByTagName(‘link’).length==1)
link[i]=items.getElementsByTagName(‘item’)[i].getElementsByTagName(‘link’)[0];

Any ideas??

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @flygoalie spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...