Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Urgent Help! How to get attributes value using xalan parser

Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to get attributes value of an xml file.
I would like to use XPATH API.
I am new to XML Parser.
If anybody knows this pl. advice asap.
My xml file sample.xml is as under:
<password xmlns='jabber:iq:auth' xdbns='jabber:iq:auth'>pass</password>
<query xmlns='jabber:iq:register' xdbns='jabber:iq:register'>
<x xmlns='jabber:x elay' stamp='20030624T06:22:04'>registered</x>
<foo xdbns='jabber:xdb:nslist' xmlns='jabber:xdb:nslist'>
<ns type='private'>jabberim refs</ns>
<query xmlns='jabber:iq:last' last='1056440297' xdbns='jabber:iq:last'>Disconnected</query>
<zerok xmlns='jabber:iq:auth:0k' xdbns='jabber:iq:auth:0k'>
<foo xmlns='jabber:x ffline' xdbns='jabber:x ffline'/>
<query xmlns='jabber:iq:roster' xdbns='jabber:iq:roster'>
<item jid='' name='radha' subscription='both'>
<item jid='' name='hari' subscription='both'>
<item jid='' name='sonal' subscription='both'>
The last element before </xdb>, there is <item> tag. I need to read its attribute jid value.
<item jid="".....>
There r 3 <item> tags in the sample file.
I need to store these attributes' value in a string array.
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic