471,337 Members | 1,122 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

XML parser for javascript

Hi Friends,

I have to perform a lot of editing of xml data on the
client-side(browser), using javascript. (before i display the data on
the browser).

Which xml parser is better for accessing and editing xml
elements/attributes through javascript code.

Greetings,
Jagdishwar.

May 10 '06 #1
7 2426
ja*******@gmail.com wrote:
Hi Friends,

I have to perform a lot of editing of xml data on the
client-side(browser), using javascript. (before i display the data on
the browser).

Which xml parser is better for accessing and editing xml
elements/attributes through javascript code.

Where does your XML come from? Why can't you use the parser built int
to the UA?

--
Ian Collins.
May 10 '06 #2
the XML data is present in a global variable (javascript global
variable).
Actually the xml is coming from a file, and i am storing into the
global variable.
the elements in that xml are not sorted.

Now, i have to sort the elements according to a specific criteria. and
then i have to display on the html in a table format.

basically i need a way to extract the individual elements and
attributes present in the xml data. then i can display on the html
page.

May 10 '06 #3
http://xmljs.sourceforge.net/

XML for <SCRIPT> is a powerful, standards-compliant JavaScript XML
parser that is designed to help web application designers implement
cross platform applications that take advantage of client-side
manipulation of XML data.

May 10 '06 #4

vifito wrote:
http://xmljs.sourceforge.net/

XML for <SCRIPT> is a powerful, standards-compliant JavaScript XML
parser that is designed to help web application designers implement
cross platform applications that take advantage of client-side
manipulation of XML data.
I downloaded the "xml for <script>" from the above url.From the documentation, i see there are 3 parsers included in it.


1.W3C DOM
2.Classic DOM
3.SAX

do i need to include all the three js files for parsing the xml data.

Or, are these 3 are independent of each other, i mean can i use only
one any of these three. if this is the case, which one would be better
one.

--
Jagdishwar

May 10 '06 #5
ja*******@gmail.com wrote:
vifito wrote:
http://xmljs.sourceforge.net/

XML for <SCRIPT> is a powerful, standards-compliant JavaScript XML
parser that is designed to help web application designers implement
cross platform applications that take advantage of client-side
manipulation of XML data.

I downloaded the "xml for <script>" from the above url.
From the documentation, i see there are 3 parsers included in it.


1.W3C DOM
2.Classic DOM
3.SAX

do i need to include all the three js files for parsing the xml data.

Or, are these 3 are independent of each other, i mean can i use only
one any of these three. if this is the case, which one would be better
one.

If the names accurately describe the components that all depends what
you have to do with the data.

DOM parsers will build a compete DOM of the document in memory, a SAX
parser will extract specific tags from the document for immediate
processing.

--
Ian Collins.
May 10 '06 #6
ja*******@gmail.com wrote:
I have to perform a lot of editing of xml data on the
client-side(browser), using javascript. (before i display the data on
the browser).

Which xml parser is better for accessing and editing xml
elements/attributes through javascript code.


Browsers will experience memory problems when it's a lot of parsing
like in your case. You will also come on sensitive browser
compatibility grounds.

I'm surprised nobody mentionned XSL here, which is the exact language
for this kind of XML sorting/filtering.

If you're only working with small/easy data, I'ld say your plan could
be okay. But, really, for bullet-proof production you are better of to
use something like CGI, PHP, Java and the like.

Hope this helps,

--
Bart

May 10 '06 #7
Bart, you are absolutely correct.
i could have gone for Java,

but the situation here for me is, i can perform at client-side only.
Our server just gives a messy xml, that i have to sort/organise and
display.

I will check whether i can use xslt on the client side.

--
Jagdishwar

May 10 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by annoyingmouse2002 | last post: by
8 posts views Thread by Phat G5 (G3) | last post: by
2 posts views Thread by David Virgil Hobbs | last post: by
7 posts views Thread by macabstract | last post: by
9 posts views Thread by Peter Michaux | last post: by
4 posts views Thread by fbrewster | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.