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
1 answer

PHP XML xlink:href Attributes

I'm having trouble reading attributes from the Spreadshirt API with SimpleXML. I can't grab the xlink:href attribute from resources, which is what I need as it's not displays in the data received. Seem to be able to grab everything else,…
Mike Kaperys
  • 160
  • 1
  • 1
  • 9
1
vote
2 answers

Getting XML attribute from the inner node using PHP SimpleXML is failing

Chaps, I am trying to get attributes of the 'file' node in the following XML with SimpleXml but every time is gives me back null. I have successfully got the attributes for the study node but fail to get the 'file' atts . here is the xml :
Sina aria
  • 125
  • 1
  • 5
1
vote
1 answer

SimpleXml and php Iteration

I've been looking at the other questions posted here on this subject but they all seem to have in common a "symetric" xml file. I start by calling: $xml_testimonials=simplexml_load_file("bck/testimonials.xml"); I cant iterate this file:
Marvin
  • 503
  • 2
  • 7
  • 17
1
vote
1 answer

SimpleXMLElement Object is missing nodes

I'm using simplexml_load_string to parse XML data. Everything has been going fine, except for 1 exception where certain child nodes seem to be missing. Here's a sample of the original XML output:
JerryAsk
  • 11
  • 3
1
vote
1 answer

PHP RSS Feed not showing

New to PHP and was just playing around with RSS feeds. I'm currently just trying to display the RSS feed from here: http://www.polygon.com/rss/index.xml. Bbut I think my code is broken somewhere and was hoping someone could shed some light on the…
StackUnderFlow
  • 339
  • 1
  • 11
  • 36
1
vote
1 answer

Accessing CDATA values in a simplexmliterator

I have a simple xml structure:
Chris Schmitz
  • 20,160
  • 30
  • 81
  • 137
1
vote
0 answers

Speed issue with simplexml - XML files referencing other XML files

I hope this is clear - I tried searching for questions related to speed and simplexml, but didn't find anything that quite matches my problem: I am writing a search function - the search itself returns an XML file (example:…
1
vote
3 answers

PHP XML data missing custom attribute data

I have custom XML of the following format: node data#1
sisko
  • 9,604
  • 20
  • 67
  • 139
1
vote
1 answer

Loading xml document and filter it with xpath

Im using PHP to load a XML document: $xmlDocument = file_get_contents($url, false, $context); $xmlString = simplexml_load_string($xmlDocument); XmlString and $url : http://testing.zwiink.us/getPurchased.php Now im trying to filter out each element,…
dane
  • 25
  • 2
1
vote
1 answer

SimpleXML xpath to filter out objects

I'm trying, to filter out all SimpleXMLElement Objects, which contain the value "fds". $xmlDocument = file_get_contents($Url, false, $context); $xmlString = simplexml_load_string($xmlDocument); $root =…
dane
  • 25
  • 2
1
vote
1 answer

how to check if xml file has more than one child values using php

i have xml file $file.xml which includes the following name1name2name3 i need a way to check if has more than one child meaning that if the file has more…
Ayman
  • 131
  • 1
  • 9
1
vote
1 answer

Retrieve and parse XML records related to MySQL result

I am trying to get information out of an XML file and I can´t get it to work. Here is my code: $xml = simplexml_load_file('http://www.website.de/file.xml'); $query = "SELECT * FROM table WHERE shop='name' and datum='' LIMIT 5"; $result =…
Dennis
  • 595
  • 1
  • 6
  • 22
1
vote
0 answers

SimpleXML content:encoded node missing

I'm trying to get the RSS feed from a WordPress.com blog with SimpleXML, but the content node is missing. Here's my code: $feed = file_get_contents('http://blog.wordpress.com/category/category-name/feed'); $xml =…
user1912899
1
vote
1 answer

Php Fetch the value from this XML string

I have an XML string like below getting returned from an API call
pal4life
  • 3,210
  • 5
  • 36
  • 57
1
vote
2 answers

PHP - Extract XML data to a 2d array

I was wondering if someone could give me a hand. I have a KML file (Google Maps XML) and I need to extract the coordinates to a 2D array. The format of the file is as follows:
BigJobbies
  • 499
  • 8
  • 20