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

SimpleXML changing parsed decimals

I have this xml file - http://gamebattles.majorleaguegaming.com/ps4/call-of-duty-ghosts/team/ngx2-gaming/stats.xml here which I am outputting the element "winPercentage" as seen…
KJThaDon
  • 416
  • 3
  • 15
1
vote
1 answer

PHP xpath get tag name

I have an xml file like this:
max13
  • 63
  • 2
  • 5
1
vote
2 answers

How to import XML using PHP?

I've been creating a simple website for a client (I'm a designer with front-end skills) but I've been thrown a curve ball and now they want a catalogue of products imported via a CSV or XML file. I've chosen the XML option as I have even less of a…
sarah3585
  • 637
  • 13
  • 37
1
vote
1 answer

Parse through unknown XML

I've made a simple tool that lets you fill in an input field with a URL for an XML file. It's supposed to show all the nodes so the user can match them with database fields, which I have working for an XML file that has 2 "primary" nodes. Example of…
user1433479
  • 135
  • 1
  • 5
  • 20
1
vote
1 answer
1
vote
1 answer

How to find other children's value using simplexml

total_kills 9999 total_deaths 1234 How do I search for "total_kills" to get the value "9999"…
1
vote
1 answer

Scraping YouTube XML to embed via SimpleXML—where am I going wrong?

I'm trying to use this query to find the precise videos I want via XML, then I'm looking to parse the values with SimpleXML and insert them in the DOM via this method. I was experiencing a strange problem earlier when pulling the value from:…
Joshua Cody
  • 3,742
  • 5
  • 32
  • 34
1
vote
2 answers

PHP Get Total Sum Value From XML Response Tree

Im trying to get the total sum value from a specific xml tree like so: Example response from 3rd party: 2014-02-01 2014-02-25 Web
user1371519
  • 39
  • 1
  • 7
1
vote
4 answers

PHP won't echo XML child

Here is my code
Rob
  • 7,980
  • 30
  • 75
  • 115
1
vote
3 answers

XPath Query using contains with multiple values

I need an XPath that will elect all parent nodes a child with anattribute that constains at least one of a list of values. Example XML
prodigitalson
  • 60,050
  • 10
  • 100
  • 114
1
vote
1 answer

Reading SimpleXML Element Attributes, doesn't work

I know this has been answered before. I spent my afternoon reading all suggestions and the SimpleXML documentation of course. But this seems a kind of special case and I really can't make this work. Just to know the context, I am parsing a GPX file…
donnadulcinea
  • 1,854
  • 2
  • 25
  • 37
1
vote
1 answer

Why is my SimpleXMLElement data truncated?

I retrieve the following XML data:
Kalessin
  • 2,282
  • 2
  • 22
  • 24
1
vote
0 answers

simplexml_load_file with

I am trying to get content from a XML file, but it's not really returning everything. Here is the XML url for example: XML Example Extract:
Arko Elsenaar
  • 1,689
  • 3
  • 18
  • 33
1
vote
3 answers

PHP XML parsing going directly to value by attribute

i have a XML document that looks like this: ab abc etc... Now, i need to get the value for a key, the document is very very…
user2559108
1
vote
1 answer

How do I set an existing SimpleXMLElement attribute?

I am running the following code: $attributes = $xmlTable2->attributes(); foreach ($attributes as $key => $value) { $xmlTable1->addAttribute($key, $value); } But it causes an error: Warning: SimpleXMLElement::addAttribute(): Attribute already…
NobleUplift
  • 5,631
  • 8
  • 45
  • 87
1 2 3
99
100