Linked Questions
11 questions linked to/from How can I set text value of SimpleXmlElement without using its parent?
2 votes
1 answer
521 views
PHP: Is it possible to pass xml node to function by ref and make change? [duplicate]
I wish to pass a xml node to a function by ref, and make change within the function. But seem the node's value couldn't be changed in this way. Example: <?php $str = '<data><name>foo&...
0 votes
1 answer
79 views
PHP-SimpleXML: Editing nodes and its attributes [duplicate]
In a PHP script, I want to edit a node and its attributes. <config> <Week> <Monday from="18:00:00" to="8:00:00">true</Monday> <Tuesday from="18:00:00" ...
58 votes
18 answers
117k views
Remove a child with a specific attribute, in SimpleXML for PHP
I have several identical elements with different attributes that I'm accessing with SimpleXML: <data> <seg id="A1"/> <seg id="A5"/> <seg id="A12"/> <seg id="...
11 votes
4 answers
25k views
edit XML with simpleXML
How can I edit the value's in a xml file using simpleXML ? I know how to create the file, but not how to edit the value in an existing file ?
1 vote
3 answers
9k views
php SimpleXMLElement set text
how to set text for a SimpleXMLElement in php?
4 votes
6 answers
4k views
How to tell apart SimpleXML objects representing element and attribute?
I need to print arbitrary SimpleXML objects in a specific manner, with special handling of attribute nodes. The problem is that SimpleXML elements and attributes seem to use exactly the same class, ...
5 votes
2 answers
14k views
Change the value of a text node using SimpleXML
I am trying to write a code where it will find a specific element in my XML file and then change the value of the text node. The XML file has different namespaces. Till now, I have managed to register ...
2 votes
2 answers
1k views
Iterating through and editing a SimpleXML object by reference in PHP
I am writing a function to decrypt the contents of a SimpleXML object in place. function xmlWalkerDecrypt(&$xmlObj, $aesKey) { if ($xmlObj->count()>0){ foreach($xmlObj as &$...
0 votes
3 answers
365 views
Remove a node from XML with namespace and generate new XML
I am trying to filter the results of an XML feed generated for Facebook. Currently, the feed looks like this <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:g="http:...
-1 votes
3 answers
188 views
How to loop over an array and conditionally update a nested value
I have two arrays like: array (size=4) 0 => string '5' (length=1) 1 => string '4' (length=1) 2 => string '2' (length=1) 3 => string '2' (length=1) 3 => string '8' (length=1) and ...
0 votes
2 answers
47 views
setting content of Simplexml node
I have a DomElement <title> <language id="1" /> <language id="2" /> </title> I want to set the content of both languages $node=$pp->title foreach($node->language ...