473,395 Members | 1,677 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,395 software developers and data experts.

I need a xml parser script

Hello all. After a thousand experiments I got really bored. Could a kind person who knows php write a simple script returning the contents of a remote xml file?

I don't know PHP, and honestly I don't have the time to learn right now. Thanks in advance.
Sep 22 '07 #1
5 1525
pbmods
5,821 Expert 4TB
Heya, Newholborn.

You posted this in the Articles section. I'll go ahead and move it to the Forum where an Expert will be more likely to find it.

TSDN members are expected to write their own code. We're happy to help you out if you have specific questions, but you can't realistically expect someone to do your coding for you on a free forum.
Sep 22 '07 #2
bergy
89
Well, I'm not going to write the parser for you, but I can tell you how to get a remote file in 5-6 lines using cURL. Below is an example, I'm sure you can find an XML parser somewhere on the internet.

[php]
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
$url = "http://www.somesite.com/xml.xml";
$curl = curl_init();
curl_setopt($curl, CURLOPT_USERAGENT, $useragent);
curl_setopt ($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$str = curl_exec ($curl);
curl_close ($curl);
echo $str;
[/php]
That PHP would echo the remote file's contents.
Sep 22 '07 #3
pbmods
5,821 Expert 4TB
There's an XML parser built into PHP.
Sep 22 '07 #4
pmbods, I understand, but I really can't bother learning php right now, I have an Ajax demo to build so I can get a new job, and I need the php file to make it work. I won't have to learn php for this job, its just a temporary thing. btw, sorry about misplacing the post but the Forums and Articles tabs are almost identical :P

Anyway, the script didn't work, I get a javascript 404 error and i don't get it. Plus, I'm new to the forums and I dont know if i should post in the Ajax, or the PHP section :P

Oof, I don't know what to do :P

Cheers.
Sep 22 '07 #5
pbmods
5,821 Expert 4TB
Can you write the backend in ASP (or whatever language you are comfortable with)?
Sep 22 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Simon Foster | last post by:
Anyone have any experience or pointers to how to go about creating a parser lexer for assemble in Python. I was thinking of using PLY but wonder whether it's too heavyweight for what I want. ...
4
by: annoyingmouse2002 | last post by:
Hi there, sorry if this a long post but I'm really just starting out. I've been using MSXML to parse an OWL but would like to use a different solution. Basically it reads the OWL (Based on XML)...
2
by: Mette Kulmbach | last post by:
I'm a danish librarian who would like to get my new homesite validated. I have tried to get it validatet in the w3c but I get the same message all the time. This is the massage. " Below are...
1
by: Srinivasa Parupalli | last post by:
Dear Friends, I am struck up with logic. I am using one class(BMSLexer) which takes filename as arugument and the instance of the class is used my another class. example is shown below. Now my...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
2
by: Joel Hedlund | last post by:
Hi! I have a possibly dumb question about imports. I've written two python modules: parser.py ------------------------------------ class Parser(object): "my parser"...
27
by: comp.lang.tcl | last post by:
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: set...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
12
by: Robbo | last post by:
Hi, My database contains 45 tables the structure of which is evolving as I develop. I need a utility that will "read" the structure of this database and it's tables and then create an identical...
18
by: Just Another Victim of the Ambient Morality | last post by:
Is pyparsing really a recursive descent parser? I ask this because there are grammars it can't parse that my recursive descent parser would parse, should I have written one. For instance: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.