Connecting Tech Pros Worldwide Forums | Help | Site Map

XML parser for javascript

jagsmiles@gmail.com
Guest
 
Posts: n/a
#1: May 10 '06
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.


Ian Collins
Guest
 
Posts: n/a
#2: May 10 '06

re: XML parser for javascript


jagsmiles@gmail.com wrote:[color=blue]
> 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.
>[/color]
Where does your XML come from? Why can't you use the parser built int
to the UA?

--
Ian Collins.
jagsmiles@gmail.com
Guest
 
Posts: n/a
#3: May 10 '06

re: XML parser for javascript


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.

vifito
Guest
 
Posts: n/a
#4: May 10 '06

re: XML parser for javascript


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.

jagsmiles@gmail.com
Guest
 
Posts: n/a
#5: May 10 '06

re: XML parser for javascript



vifito wrote:[color=blue]
> 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.[/color]

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

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

Ian Collins
Guest
 
Posts: n/a
#6: May 10 '06

re: XML parser for javascript


jagsmiles@gmail.com wrote:[color=blue]
> vifito wrote:
>[color=green]
>>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.[/color]
>
>
> I downloaded the "xml for <script>" from the above url.[color=green]
>>From the documentation, i see there are 3 parsers included in it.[/color]
>
> 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.
>[/color]
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.
Bart Van der Donck
Guest
 
Posts: n/a
#7: May 10 '06

re: XML parser for javascript


jagsmiles@gmail.com wrote:
[color=blue]
> 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.[/color]

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

jagsmiles@gmail.com
Guest
 
Posts: n/a
#8: May 10 '06

re: XML parser for javascript


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

Closed Thread


Similar JavaScript / Ajax / DHTML bytes