473,698 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting data from a feed file

Ok, I have a feed that I need to get the data from. The file is an
html file that contains items. I need to step through the file,
getting the first item, doing whatever, then the second item, and so
on. Any thoughts on the best way to to this?

<Feed>
<Item>
<ID>Data I need</ID>
<Title>Data I need</Title>
</Item>
<Item>
<ID>Data I need</ID>
<Title>Data I need</Title>
</Item>
</Feed>

Jun 14 '07 #1
5 1599
On Jun 14, 3:59 pm, j...@mynetserv. com wrote:
Ok, I have a feed that I need to get the data from. The file is an
html file that contains items. I need to step through the file,
getting the first item, doing whatever, then the second item, and so
on. Any thoughts on the best way to to this?

<Feed>
<Item>
<ID>Data I need</ID>
<Title>Data I need</Title>
</Item>
<Item>
<ID>Data I need</ID>
<Title>Data I need</Title>
</Item>
</Feed>


Yes, try these functions (explained at php.net with examples):

xml_parser_crea te()
xml_parser_set_ option()
xml_parse_into_ struct()
xml_parser_free ()

These four , come one after another, and they will help you parse the
file easier.

If you prefer regular expressions, let me know :-)

BeachAndCocktai ls

Jun 14 '07 #2
je***@mynetserv .com wrote:
Ok, I have a feed that I need to get the data from. The file is an
html file that contains items. I need to step through the file,
getting the first item, doing whatever, then the second item, and so
on. Any thoughts on the best way to to this?

<Feed>
<Item>
<ID>Data I need</ID>
<Title>Data I need</Title>
</Item>
<Item>
<ID>Data I need</ID>
<Title>Data I need</Title>
</Item>
</Feed>
Did you check out the DOM functions in PHP 5 (or DOM XML functions in
PHP 4)?

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Jun 14 '07 #3
On Jun 14, 12:54 pm, Vladimir Ghetau <vladi...@pixel tomorrow.com>
wrote:
On Jun 14, 3:59 pm, j...@mynetserv. com wrote:
Ok, I have a feed that I need to get the data from. The file is an
html file that contains items. I need to step through the file,
getting the first item, doing whatever, then the second item, and so
on. Any thoughts on the best way to to this?
<Feed>
<Item>
<ID>Data I need</ID>
<Title>Data I need</Title>
</Item>
<Item>
<ID>Data I need</ID>
<Title>Data I need</Title>
</Item>
</Feed>

Yes, try these functions (explained at php.net with examples):

xml_parser_crea te()
xml_parser_set_ option()
xml_parse_into_ struct()
xml_parser_free ()

These four , come one after another, and they will help you parse the
file easier.

If you prefer regular expressions, let me know :-)

BeachAndCocktai ls
I am looking into the xml_parser_ functions. Currently my feed doesn't
seem to be XML encoded, or complaint.

How would I do it with regular expressions?

Jun 14 '07 #4
How would I do it with regular expressions?

http://www.phpclasses.org/browse/package/3504.html
Enjoy,

Vladimir
http://pixeltomorrow.com
Jun 17 '07 #5
jerry wrote:
I am looking into the xml_parser_ functions. Currently my feed doesn't
seem to be XML encoded, or complaint.
The example you gave was.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 113 days, 23:54.]

You're Not Allowed to Take Pictures of the US Embassy in Rome
http://tobyinkster.co.uk/blog/2007/06/16/us-embassy/
Jun 17 '07 #6

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

Similar topics

1
2402
by: ru | last post by:
Hello, I'm trying to parse a rss 1.0 docoment like the following example from http://www.instapundit.com: <?xml version="1.0" encoding="iso-8859-1" ?> - <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/"
2
3019
by: N. Graves | last post by:
I'm planning to develop a process to import data from an external flat file to a new table automatically. As usual I'm having a hard time getting started on the solution because of the Access's flexibility. Please help me with your suggestion's about the best way accomplish this or do you know of any examples that I could review or download. Thanks in advance! Norris
7
17321
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem to get it to work in Visual Basic. I tried coding it once myself from scratch and then modified a class that I found on a newsgroup (referenced below). Both seem to be doing the same thing and neither works (or rather, they seem to work but the...
7
2628
by: billy | last post by:
Hello, I have an XML data feed that I would like to use to create tables in SQL Server. The xml data feed consists of a large amount of information that changes on a regualar basis. Is there a way to automatically create SQL Server tables using the data feed? Thanks Billy
15
2334
by: Brady Love | last post by:
I am currently working an an app that will post and edit blogs on blogger. Right now I have it so I can recive a list of the blogs and the content of those blogs using Atomizer. This is my first program where I am accessing data over the net.When I go to retrieve the list of blogs my program acts like it is locked up/frozen for a few seconds and then when it is done it goes back to normal. Does anyone know how I would get rid of the...
1
2334
by: jcsnippets.atspace.com | last post by:
Hi everyone, I'm trying to read an xml config file in C#. To do this, I have used the xsd.exe tool to create an xsd file from my xml, and to generate code to read this xml file. Here is a small sample of my xml file: <feed> <location> <directory>data</directory>
5
2433
by: Ed Flecko | last post by:
Hi folks, I'm trying to figure out this whole RSS feed thing. I've created my .xml file to use for my feed, and my browsers "recognize" that I have an RSS feed, and you can subscribe, etc., etc. Here's why I "think" I want to use an RSS feed, and what I'm confused about. I have one file (and one file only) on my web site that changes
1
2290
by: FLX | last post by:
Hello, I'm trying to scrape daily titles from http://www.doopes.com/?cat=35444&lang=1&num=5&mode=0&from=2007-09-04&to=2007-09-04&exc=&inc=&opt=0 But i'm getting lost using preg_match. Can someone help me with this script? Thanks in advance! <?php
7
28898
Merlin1857
by: Merlin1857 | last post by:
Its great producing data for users to look at in your web pages and generally that is sufficient for their needs but sometimes you may want to supply your user with the data in a form they can actually do something more with. This code shows you how to display data from your database and then how to give that data to the user in the form of a useable Excel spreadsheet which they can then take away and play with themselves. The way I have shown...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8901
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7739
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.