Questions tagged [simplexml]

A PHP extension shipped with the main source tree. The SimpleXML extension provides a very simple and easily usable toolset to convert XML to an object that can be processed with normal property selectors and array iterators. For the Java "Simple" XML framework, please use the [simple-framework] tag.

The SimpleXML extension provides a simple toolset to convert XML to an object that can be processed with normal property selectors and array iterators.

Once an XML document is converted, the object obtained will reference the root element of the document. The object's properties will reflect the child nodes and uses the same name as the nodes. This principle works recursively across the document.

3932 questions
1
vote
2 answers

Getting child and sub-child elements from XML in PHP with SimpleXMLElement

Okay, what should be a simple little task has already cost me three days! I am working with PHP on OS X 10.6.8 and for various reasons cannot upgrade to Mavericks, so I am stuck without a proper PHP IDE and damned to TextWrangler. So here's my…
rpmth
  • 75
  • 1
  • 10
1
vote
2 answers

Explode the attribute in XML File

I have an XML with attribute like this:
1
vote
3 answers

PHP: Need he!p with simple XML

I am beginner in PHP. I am trying to parse this xml file. true true xxxx xxxx
Bruce
  • 33,927
  • 76
  • 174
  • 262
1
vote
1 answer

How to get the last node value in xml

I want to get the value of last id in item element. For example, in the xml below, I want to get value 2 and increment one for the id for next item entered. So if the next item is entered, the id will automatically be 3 and so on. Tried couple ways…
bisonsausage
  • 71
  • 3
  • 12
1
vote
2 answers

XMLparsing issue PHP

Im trying to parse the following XML : <![CDATA[Van Gaal: Keep the faith]]>
n4zg
  • 387
  • 2
  • 6
  • 20
1
vote
1 answer

Can not get node value using simplexml in php

I have the following XML file
Tester
  • 798
  • 2
  • 12
  • 32
1
vote
3 answers

PHP / SimpleXML not showing all content

I have the following PHP code: Output is: SimpleXMLElement Object ( [id] =>…
Sinan
  • 83
  • 3
  • 9
1
vote
3 answers

How to display XML elements by the value of their attributes using PHP

I'm trying to run some reporting for an event feed that I have. I'm using the web services that my event manager provides to create an XML file using PHP. That is working great. This is the XML that I am getting:
1
vote
3 answers

How to get value with simplexml?

I have XML-file and i try to get value. I need value 12345 from variable media_id. How i can get it with php and simplexml? video_episode
Rane
  • 51
  • 5
1
vote
1 answer

PHP XPath - Display parent whose child

I have following script:
Michal Vlasák
  • 247
  • 2
  • 14
1
vote
3 answers

How do I access variables with hyphenated names in Smarty?

I've got a PHP page that parses an XML file with SimpleXml, then passes that object to a Smarty template. My problem is that the XML file has hyphens in its tag names, e.g. video-player. In PHP, this is no problem, I just use $xml->{'video-player'}…
abeger
  • 6,766
  • 7
  • 41
  • 58
1
vote
4 answers

PHP XML - get all attributes of segment by it's id

I've got new question: is there a way to get all attributes of xml element when i'm selecting this element by it's id ? i've got xml response that looks like this:
arclite
  • 528
  • 1
  • 6
  • 23
1
vote
1 answer

Attributes in array created by SimpleXML are displayed as NULL

I have the following XML: Wasserkocher I have turned it into an array with SimpleXML, and the result looks like…
Watchduck
  • 1,076
  • 1
  • 9
  • 29
1
vote
1 answer

Read first element+attributes and secondary elements+attributes of a XML file on PHP5

Actually I want my page to read this XML file on PHP5. I have this example as my samples.xml file: ...
user3050478
  • 272
  • 3
  • 19
1
vote
1 answer

Path to image directory needs to include subfolders too

so I have this code that i am using to allow for livesearch of all my images using xml data sheet. What I am having trouble with now is being able to see the subfolder names being integrated into the file name of each image. The idea is that I will…
WebEducate
  • 79
  • 2
  • 17