XML Parsing code help please!
Posted: Sat Aug 18, 2007 7:23 am
feyd | Please use
I know just enough PHP to be able to format the output as I would like, but I have never used XML before, and I can't seem to get any examples I have found so far to work.
My goal is to be able to call http://www.mysite.com/articleget.php?article=MyArticle1 or similar and have it return the correct article in the XML database that matches the Heading tag.
Can anyone please help? I tried reading all the documentation and I'm just getting more and more confused!
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi guys,
I'm trying to write a PHP script which will parse the following XML:
[syntax="xml"]<MyBook>
<ArticleName>
<Heading>Article 1</Heading>
<Quote1>Some text</Quote1>
<Quote2>Some other text</Quote2>
<Quote3>Even more text</Quote3>
<Article>Blah blah blah blah blah blah blah blah blah</Article>
<Comment1>A comment goes here</Comment>
<Comment2>Another comment here</Comment2>
</ArticleName>
<ArticleName>
<Heading>Article2</Heading>
blah blah blah to Article 80 or so
</MyBook>My goal is to be able to call http://www.mysite.com/articleget.php?article=MyArticle1 or similar and have it return the correct article in the XML database that matches the Heading tag.
Can anyone please help? I tried reading all the documentation and I'm just getting more and more confused!
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]