Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

accessing XML tags in JavaScript

Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a CRM project and facing a problem, which needs to be fixed, urgently.
In my application there is a Mailbox and there is a owner of the mailbox. At the time of loading attributes of all emails (to, bcc, cc, content, subject....etc etc) are fetched from the DB and populated in an java object(this object contains a Vector further containg the above fields), at app server. In JSP this object is converted to a string containing the detail and is send to the JavaScript. Now here it(java object) is converted to a javascript variable and stored in the browser. This object is used to pl remember this object contains information about all the emails in the mailbox)
1.update the User interface and
2. to cache the details of the emails to improve client speed and minimize the server trips.
My first purpose is solved but the second case is posing problems. This is due to the corruption of this huge javascript variable over a period of time.
Now i am planning to pass the emails information in XML format and storing the same in DOM object instead of javascript variable, but I don't know how to access XML tags from Javascript.
This is required because my code for updation of UI and cache implementation lies in the Javascript.
So can somebody tell me:
1. How to access XML tags from javascript code.
2. whether my approach to the problem is correct.
Thanks for your time and looking for help...
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To access XML tags from JavaScript you can use DOM interface.
Take a look at these examples, is it what you want?
This post can be useful, except I had to read it a few times to understand
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shikhar.
If you can rely on your clients to use the same browser, and that browser is IE 5, you can invoke an MS XMLDOM object client-side, and the rest is easy.
If you use another platform... I don't know what to do..
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!