473,396 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to parse xml in JS

Hello everyone, I looking for a gently solution
how to get information from xml (giving url) and
then format and print with JS with interval

Thanks for a tip.

PM
Nov 20 '07 #1
6 1424
VK
On Nov 20, 9:21 pm, "Piotr Maslak" <piotr.mas...@wp.plwrote:
Hello everyone, I looking for a gently solution
how to get information from xml (giving url) and
then format and print with JS with interval
You cannot work with data across different domains. There are
different ways to use different auxiliary transports for cross-domain
XML data transfer (Web Services, Runtime Script Blocks, JSONet) - but
they are rather or very far from anything being "gently" :-)

For the same domain data exchange I would suggest AjaxToolBox
http://www.ajaxtoolbox.com
Nov 20 '07 #2
VK wrote:
On Nov 20, 9:21 pm, "Piotr Maslak" <piotr.mas...@wp.plwrote:
>Hello everyone, I looking for a gently solution
how to get information from xml (giving url) and
then format and print with JS with interval

You cannot work with data across different domains. There are
different ways to use different auxiliary transports for cross-domain
XML data transfer (Web Services, Runtime Script Blocks, JSONet) - but
they are rather or very far from anything being "gently" :-)
What an odd opinion. I would say the direct opposite. It are server-
side XML scripts that open the real possibilities, not XMLHttpRequest.
Virtually any server side language is able to make remote requests
(typically using sockets, but I've also used plain HTTP, ot whatever
channel that both parties understand). Most of the server languages
also have XML parsers. From the point you have those two tools (remote
requests + XML parser), the sky is the limit.

I think Douglas Crockford is very right to propose his JSONRequest,
which could hopefully stop the XMLHttpRequest hype one day.

--
Bart
Nov 21 '07 #3
VK
On Nov 21, 11:31 am, Bart Van der Donck <b...@nijlen.comwrote:
VK wrote:
On Nov 20, 9:21 pm, "Piotr Maslak" <piotr.mas...@wp.plwrote:
Hello everyone, I looking for a gently solution
how to get information from xml (giving url) and
then format and print with JS with interval
You cannot work with data across different domains. There are
different ways to use different auxiliary transports for cross-domain
XML data transfer (Web Services, Runtime Script Blocks, JSONet) - but
they are rather or very far from anything being "gently" :-)

What an odd opinion.
What is odd in here? That JavaScript cannot operate (by default)
across domains? The OP question was about possible JS solutions, not
just about any possible solution. ;-)
It are server-
side XML scripts that open the real possibilities, not XMLHttpRequest.
Virtually any server side language is able to make remote requests
(typically using sockets, but I've also used plain HTTP, ot whatever
channel that both parties understand). Most of the server languages
also have XML parsers. From the point you have those two tools (remote
requests + XML parser), the sky is the limit.
Yes, and doubled Internet traffic worldwide ;-) :-(

With client-side cross-domain handling we have:

Client <--Server A
^-- <--Server B

With any of content-grabbers we have:

Client
Client <--Server A
^-- <--Server A <--Server B

So on each such call one has one absolutely "no added value" data
transfer.

Think of it as of a real standard and think of pentabytes of useless
data transfers across the Internet.

So no, my opinion is that server-side content-grabbers is a temporary
forced measure caused by stubbornness of UA producers (they kept
believing that it adds any security to their clients). The future is
for Web Services and server-side access permission files (WSDL).
Nov 21 '07 #4
VK wrote:
With client-side cross-domain handling we have:

Client <--Server A
^-- <--Server B

With any of content-grabbers we have:

Client
Client <--Server A
^-- <--Server A <--Server B

So on each such call one has one absolutely "no added value" data
transfer.
I'm sorry ? I would say the added value is quite obvious, namely "use
their data". But IMHO your scheme is only one part of the story. I
have much more experience with the following flux:

Server A <--Server B (e.g. nightly database updates)

And then, for the daily needs:

Client <--Server A
Think of it as of a real standard and think of pentabytes of useless
data transfers across the Internet.
I wouldn't call remote requests "useless data transfers" :-) It all
depends on what you want.
So no, my opinion is that server-side content-grabbers is a temporary
forced measure caused by stubbornness of UA producers (they kept
believing that it adds any security to their clients).
I don't agree. I think they are very valuable, and that this kind of
communication will keep existing for a very long time to come. Even if
it were only to populate a database automatically or for middleware
systems. The benefits are just too numerous.
The future is for Web Services and server-side access permission
files (WSDL).
Yes, something like that would probably have a great future for client
scripting.

--
Bart
Nov 21 '07 #5
Thanks, I understand, so now I will use php proxy script and load xml from
hidden textarea.
Nov 21 '07 #6
VK
So no, my opinion is that server-side content-grabbers is a temporary
forced measure caused by stubbornness of UA producers (they kept
believing that it adds any security to their clients).

I don't agree. I think they are very valuable, and that this kind of
communication will keep existing for a very long time to come. Even if
it were only to populate a database automatically or for middleware
systems. The benefits are just too numerous.
The future is for Web Services and server-side access permission
files (WSDL).

Yes, something like that would probably have a great future for client
scripting.
domo arigato

VK
Nov 22 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Ram Laxman | last post by:
Hi all, I have a text file which have data in CSV format. "empno","phonenumber","wardnumber" 12345,2234353,1000202 12326,2243653,1000098 Iam a beginner of C/C++ programming. I don't know how to...
24
by: | last post by:
Hi, I need to read a big CSV file, where different fields should be converted to different types, such as int, double, datetime, SqlMoney, etc. I have an array, which describes the fields and...
3
by: Jon Davis | last post by:
The date string: "Thu, 17 Jul 2003 12:35:18 PST" The problem: // this fails on PST DateTime myDate = DateTime.Parse("Thu, 17 Jul 2003 12:35:18 PST"); Help? Jon
3
by: Mark | last post by:
How do you parse a currency string to a decimal? I'd like to avoid having to parse the number out, removing the $ manually. That sounds like a hack. There are times that this string will be...
14
by: Jon Davis | last post by:
I have put my users through so much crap with this bug it is an absolute shame. I have a product that reads/writes RSS 2.0 documents, among other things. The RSS 2.0 spec mandates an en-US style...
3
by: Bob Rundle | last post by:
I would like to get something like this to work... Type t = FindMyType(); // might be int, float, double, etc string s = "1233"; object v = t.Parse(s); This doesn't work of couse, Parse is...
3
by: Slonocode | last post by:
I have some textboxes bound to an access db. I wanted to format the textboxes that displayed currency and date info so I did the following: Dim WithEvents oBidAmt As Binding oBidAmt = New...
5
by: js | last post by:
I have a textbox contains text in the format of "yyyy/MM/dd hh:mm:ss". I need to parse the text using System.DateTime.Parse() function with custom format. I got an error using the following code. ...
2
by: Samuel R. Neff | last post by:
I'm using a quasi open-source project and am running into an exception in double.Parse which is effectively this: double.Parse(double.MinValue.ToString()) System.OverflowException: Value was...
3
by: Peter Duniho | last post by:
I'm sure there's a good explanation for this, but I can't figure it out. I tried using DateTime.Parse() with a custom DateTimeFormatInfo instance, in which I'd replaced the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.