[SimpleXML] echo the whole content of an element (without theelement)

This is a discussion on [SimpleXML] echo the whole content of an element (without theelement) within the PHP Language forums, part of the PHP Programming Forums category; I'm trying to understand Php Simple XML. I have an xml file: <resource> <partners><...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008
Lorenzo De Tomasi
 
Posts: n/a
Default [SimpleXML] echo the whole content of an element (without theelement)

I'm trying to understand Php Simple XML.
I have an xml file:

<resource>
<partners><acronym title="Free software foundation">Fsf</acronym> and
Isotype</partners>
</resource>

and I have loaded it into $resource

With Simple XML i would like to echo the ***whole content*** of the
element <partners>, i.e. "<acronym title="Free software
foundation">Fsf</acronym> and Isotype".

I have tried
1. $partners = $resource->partners->asXML()
echo $partners;
but it echoes "<partners><acronym title="Free software
foundation">Fsf</acronym> and Isotype</partners>". I don't want
<partners> and </partners>.
2. $partners = $resource->partners->children()->asXML()
echo $partners;
but it echoes only "<acronym title="Free software foundation">Fsf</
acronym>", without " and Isotype".

Thank you very much.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:37 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0