• 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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

accessing XML tags in JavaScript

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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...
Shikhar
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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? http://www.w3schools.com/dom/dom_node.asp
This post can be useful, except I had to read it a few times to understand http://www.biglist.com/lists/xsl-list/archives/200101/msg00249.html
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic