Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Accessing an XML data file

Reply
Thread Tools

Accessing an XML data file

 
 
Todd
Guest
Posts: n/a
 
      05-11-2004
I have been tasked to create an app that will be run from a CD on
stand-alone machines that needs to search and retrieve data from an
XML Data Island.

The best approach that I can see to handle this is to use
DHTML/Javascript since this needs to be a browser-independent
application.

The trouble I am running into is on how to accomplish this. Is this
the best approach to handle this situation? If so how would I go about
doing this in Javascript/DHTML?

Thx
-t
 
Reply With Quote
 
 
 
 
Jim Ley
Guest
Posts: n/a
 
      05-11-2004
On 11 May 2004 11:33:45 -0700, (Todd) wrote:

>I have been tasked to create an app that will be run from a CD on
>stand-alone machines that needs to search and retrieve data from an
>XML Data Island.


Why? That seems a pretty ridiculous constraint, why have you assumed
XML is the solution?

XML is almost certainly not the solution (it very rarely is, unless
you've not got a clue what's at the other end and need to send
arbitrary complicated infosets)

The appropriate solution here would almost certainly be JSON -
www.json.org

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

 
Reply With Quote
 
 
 
 
Lasse Reichstein Nielsen
Guest
Posts: n/a
 
      05-11-2004
(Todd) writes:

> an XML Data Island.


> since this needs to be a browser-independent application.


I don't think XML Data Islands are browser independent. Event the
terminology is a Microsoft invention. The rest of us just calles i
"malformed HTML"

> The trouble I am running into is on how to accomplish this. Is this
> the best approach to handle this situation? If so how would I go about
> doing this in Javascript/DHTML?


What is the *real* problem you need to solve?
If you tellus, we migth be able to say which approach would be better.
/L
--
Lasse Reichstein Nielsen -
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
 
Reply With Quote
 
Gernot Frisch
Guest
Posts: n/a
 
      05-12-2004

"Todd" <> schrieb im Newsbeitrag
news: om...
> I have been tasked to create an app that will be run from a CD on
> stand-alone machines that needs to search and retrieve data from an
> XML Data Island.
>
> The best approach that I can see to handle this is to use
> DHTML/Javascript since this needs to be a browser-independent
> application.
>
> The trouble I am running into is on how to accomplish this. Is this
> the best approach to handle this situation? If so how would I go

about
> doing this in Javascript/DHTML?
>
> Thx
> -t


Maybe this helps you?
http://gazingus.org/html/XML_Parser_in_JavaScript.html

The main problem is to load the xml data file into a Var. I've had
some code but it's not really satisfying. Gives popup warnings under
Gecko engine and doesn't seem to work on Netscape6. Unfortunately I
can't find it anymore.

HTH,
Gernot




 
Reply With Quote
 
Berislav Lopac
Guest
Posts: n/a
 
      05-12-2004
Jim Ley wrote:
> On 11 May 2004 11:33:45 -0700, (Todd) wrote:
>
>> I have been tasked to create an app that will be run from a CD on
>> stand-alone machines that needs to search and retrieve data from an
>> XML Data Island.

>
> Why? That seems a pretty ridiculous constraint, why have you assumed
> XML is the solution?
>
> XML is almost certainly not the solution (it very rarely is, unless
> you've not got a clue what's at the other end and need to send
> arbitrary complicated infosets)
>
> The appropriate solution here would almost certainly be JSON -
> www.json.org
>
> Jim.


Nonsense.

XML is standard, but the OP should not use the data islands. DOM is a much
better and universal solution -- there is some differences in implementation
between browsers but nothing that Sarissa
(https://sourceforge.net/projects/sarissa/) and WebFX XML Extras
(http://webfx.eae.net/dhtml/xmlextras/xmlextras.html) couldn't solve.

Berislav

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.


 
Reply With Quote
 
Todd
Guest
Posts: n/a
 
      05-12-2004
What I have been tasked to do is this....
I have been given an XML file and it's DTD and I need to write a
client-side(Javascript) application that accesses these xml file.

What I need for this app to do is search on 1 field in this XML doc,
return certain fields from that file with one field being hyperlinked
to the details.

I hope that this makes sense and I really appreciate the help.
-t


"Gernot Frisch" <> wrote in message news:<>...
> "Todd" <> schrieb im Newsbeitrag
> news: om...
> > I have been tasked to create an app that will be run from a CD on
> > stand-alone machines that needs to search and retrieve data from an
> > XML Data Island.
> >
> > The best approach that I can see to handle this is to use
> > DHTML/Javascript since this needs to be a browser-independent
> > application.
> >
> > The trouble I am running into is on how to accomplish this. Is this
> > the best approach to handle this situation? If so how would I go

> about
> > doing this in Javascript/DHTML?
> >
> > Thx
> > -t

>
> Maybe this helps you?
> http://gazingus.org/html/XML_Parser_in_JavaScript.html
>
> The main problem is to load the xml data file into a Var. I've had
> some code but it's not really satisfying. Gives popup warnings under
> Gecko engine and doesn't seem to work on Netscape6. Unfortunately I
> can't find it anymore.
>
> HTH,
> Gernot

 
Reply With Quote
 
pcx99
Guest
Posts: n/a
 
      05-12-2004
Todd wrote:

> I have been tasked to create an app that will be run from a CD on
> stand-alone machines that needs to search and retrieve data from an
> XML Data Island.
>
> The best approach that I can see to handle this is to use
> DHTML/Javascript since this needs to be a browser-independent
> application.
>
> The trouble I am running into is on how to accomplish this. Is this
> the best approach to handle this situation? If so how would I go about
> doing this in Javascript/DHTML?
>
> Thx
> -t


Natively Javascript has no ability to deal with external files. It did
at one point but people were cute and used the ability to get the
contents of child frames to snoop on surfers and even phish their credit
card numbers.

You can do it through an activeX component though, there's a nice
overview and explination here (complete with cross-browser examples)...

http://javascriptkit.com/dhtmltutors/getxml.shtml

Hope this helps.

--
-------------
http://www.hunlock.com -- DHTML for the rest of us.
 
Reply With Quote
 
Gernot Frisch
Guest
Posts: n/a
 
      05-12-2004

> I have been given an XML file and it's DTD and I need to write a
> client-side(Javascript) application that accesses these xml file.
>
> What I need for this app to do is search on 1 field in this XML doc,
> return certain fields from that file with one field being

hyperlinked
> to the details.


That's what I thought of in the first place. As I pointed out: The
link I provided has a XML reader class that does exaclty what you want
it to do. Only problem is: You have to provide the content of the xml
file in a Var string. And here the fun beginns. I haven't found any
x-browser solution to read ascii data from a file without being bugged
by any message at least. IE behaves smoothly as it would when you try
to format your HDD with JS I think. Mozilla Firebird gave a question
about "Do you want to give file read access to ...". Opera (by default
installation) worked quiet, too and Netscape6 didn't work at all.
You need the xml class I pointed to and a ReadFileToVar() function
which I cannot provide (I've dumped the source coincidentally).


> I hope that this makes sense and I really appreciate the help.


Sure, XML is a great file format for exchanging data between
applications. Easy to debug, easy to read, wide acceptance.


-Gernot


 
Reply With Quote
 
Lee
Guest
Posts: n/a
 
      05-12-2004
Berislav Lopac said:
>
>Jim Ley wrote:
>> On 11 May 2004 11:33:45 -0700, (Todd) wrote:
>>
>>> I have been tasked to create an app that will be run from a CD on
>>> stand-alone machines that needs to search and retrieve data from an
>>> XML Data Island.

>>
>> Why? That seems a pretty ridiculous constraint, why have you assumed
>> XML is the solution?
>>
>> XML is almost certainly not the solution (it very rarely is, unless
>> you've not got a clue what's at the other end and need to send
>> arbitrary complicated infosets)
>>
>> The appropriate solution here would almost certainly be JSON -
>> www.json.org
>>
>> Jim.

>
>Nonsense.
>
>XML is standard, but the OP should not use the data islands.


XML is a standard way to represent data when you don't know
anything about the system that will be accessing that data.
It is not "the" standard way to represent data.

 
Reply With Quote
 
Richard Cornford
Guest
Posts: n/a
 
      05-12-2004
Todd wrote:
> What I have been tasked to do is this....
> I have been given an XML file and it's DTD and I need to write a
> client-side(Javascript) application that accesses these xml file.
>
> What I need for this app to do is search on 1 field in this XML doc,
> return certain fields from that file with one field being hyperlinked
> to the details.
>
> I hope that this makes sense and I really appreciate the help.


The other detail that you mentioned in your first post was that the
result of this effort was to be available on a CD. CDs have two
characteristics that seem relevant to the problem as stated: they have a
considerable storage capacity and whatever goes onto one is fixed at the
point the CD is burnt/manufactured.

This makes me wonder whether you need to use client-side scripting to
attempt to read an XML file at all. As the XML data must be fixed at the
point of creating the CD there must also be a finite number of search
permutations and results. My thoughts go to pre-processing, taking you
XML data and creating pre-processing scripts that will generate
ordinarily interlinked HTML files for all the search possibilities, in a
form/structure that makes it possible for a user to extract the
specifics as if they were searching the data, but in reality they are
just following links to pre-formed HTML pages.

The result would likely be an enormous number of HTML files, but you do
have an entire CD to store them on.

And since the point of getting the data in XML form is probably to allow
later revisions to use updated XML files you would want to hang on to
the pre-processor scripts so that you could build the corresponding
contents for the next CD version form the new XML file as easily as
building the first (easier as it would no longer be necessary to create
the pre-processor).

(while you were working on the pre-processors it would probably be a
good idea to arrange for it to output some sort of test script in
addition to the HTML data so that the integrity of the result could be
verified following the creation of the CD, it would not be easy to do
that by hand).

> "Gernot Frisch" <> wrote in message

<snip>

Please do not top-post to comp.lang.javascirpt. Apart form the extra
work it creates for experienced Usenet users and the fact that it
demonstrates a failure to read the group's FAQ (a pre-requisite on
technical groups) or a disregard of it's contents (unwise), top-posting
will also give a number of the people who could offer valuable
assistance the impression that you are not worth their gong out of their
way to help. And you are the only person who will suffer for that.

Richard.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Announce] Stylus Studio 2007 XML Enterprise Suite Released: XML Pipeline, XML Publishing and Data Conversion API's stylusstudio@gmail.com Java 0 09-26-2006 05:04 PM
[ANN] Stylus Studio 2007 XML Enterprise Suite Released: XML Pipeline, XML Publishing and Data Conversion API's Stylus Studio XML 0 09-26-2006 04:49 PM
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
ASP XML Support - Generate XML string from FORM DATA based on XML schema Matt ASP General 3 04-23-2004 07:12 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57