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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

javascript vs java XML parsers

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I was just exploring more on Javascript XML Parser, Xpath and XSL.
When I compare two approaches of using Javascript parsers with that of the Java parsers, I see advantages using java parsers.

Disadvantages When Parsing using Javascript:
1. Cross Browser compatibility: Well know Issue. Some browsers does not support all the parsers.
2. Security: XML is downloaded on to the client machine. If the document contain any sentitive data then it will be on client machine unless temporary files are deleted.

Advantages of using Browser parsers using Javascript:
1. Asynchronous requests: XMl documents returned by asynchronous requests using AJAX technology can be parsed and shown to the user on the fly.

Advantages Java parsers:
1. XML documents are not downloaded on the client machine but parsed at the server side and html is returned to the client through response object.
2. Asynchronous requests still can be made using AJAX technology, but instead of sending XML documents, send html back to the browser. (I haven't tried this but I think it is possible). (We can have UI renders classes that will parse these XML documents and apply any stylesheets necessary. I am not sure how fast this would be).

Did anyone compare these two approaches? and which one do you think is better?

Any thoughts?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use the server since not every browser supports transformations by the browser, plus JavaScript can be turned off, the server can't.

I have an example in my book (ajax In Action) to do transformations to show it can be done, but I had to say it only worked in certain browsers. Sorts of limits your audience.

Eric
 
s penumudi
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Eric.

I did read "AJAX In Action" and I liked it a lot. It gave good exposure on Patterns and security.

Thank you for your response.
 
reply
    Bookmark Topic Watch Topic
  • New Topic