PDA

View Full Version : Need help on creating a parsing script...



Joe-W
05-23-2005, 08:32 AM
Hi all, I have been trying to create a little script using PHP, that would filter a XML-formatted purchased order summary, to find out within that order summary file, which purchased order(s) contains a particular item, and that order(s) is going to be sent to a certain zip code.

However, after thinking a bit about my needs, I think using Javascript to create a client side script, will suit my needs better, but I am not that familiar with Javascript :(, thus I hope someone in this forum is kind enough to offer me some help.
--------------

As for the script,

1) It needs to take the XML-formatted order summary as an input, which within that XML file, there are multiple purchased orders.

2) It needs to find out which order contains a specific item, and if it does, whether or not that order is going to ship to a certain zip code.

3) Then it needs to output a XML file, which is a summary of those orders that fit the above criteria.
--------------

How difficult it is to write a script with Javascript to perform the above task? If anyone is kind enough to help out, please let me know via email. Thanks in advance! :o

mwinter
05-23-2005, 11:23 AM
Hi all, I have been trying to create a little script using PHP, that would filter a XML-formatted purchased order summary, to find out within that order summary file, which purchased order(s) contains a particular item, and that order(s) is going to be sent to a certain zip code.So presumably this script is only going to be used by someone reviewing received orders (report generation, effectively), not a customer?


[...] How difficult it is to write a script with Javascript to perform the above task?It's hard to say as you haven't provided the DTD, but it could be a lot of work to do from scratch. There may be existing code libraries that perform XML parsing implemented in ECMAScript/Javascript, but I know PHP has an XML parser.

There's also the question of data origin. That may affect how workable a client-side script may be. So in summary, it is possible, but you'll have to provide more information.

Mike