# Parsing multi paragraph XML

**URL:** <https://forum.kirupa.com/t/parsing-multi-paragraph-xml/231609>\
**Category:** programming\
**Created:** [July 6, 2007, 5:38am UTC](https://forum.kirupa.com/t/parsing-multi-paragraph-xml/231609 "2007-07-06T05:38:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stebbo](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@stebbo](https://forum.kirupa.com/u/stebbo)\
**Post date:** [July 6, 2007, 5:38am UTC](https://forum.kirupa.com/t/parsing-multi-paragraph-xml/231609/1 "2007-07-06T05:38:16Z")

</div>

Hello All,

I am a complete newbie to PHP and XML although I am a programmer and have a good understanding of HTML.

I came across an XML parser (the intermediate one) by Jubba I think it was on the kirupa site which does most of what I need, except it doesn’t work with the XML data that I have, as the text of the story I need is enclosed another level down within a \<bodytext\> tag, and multiple paragraph tags.

It looks something like this  
\<story\>  
[all sorts of other tags here, most of which I don’t need]  
\<bodytext\>  
\<p\>paragraph 1\</p\>  
\<p\>paragraph 2\</p\>  
\</bodytext\>

If I use BODYTEXT as the tag within the script, I don’t get any of the articles, but if I use one of the other tags, such as ABSTRACT then the script works and I get the headlines and the abstracts.

If someone could help me modify the script to handle this XML structure I would be most happy. The link to the script is [http://www.kirupa.com/web/xml\_php\_parse\_intermediate.htm](http://www.kirupa.com/web/xml_php_parse_intermediate.htm)

Kind Regards,  
Chris Stebbing.
