DOMDocument


Posted on 16th Feb 2014 07:03 pm by admin

Hello All,

I need to take an XML document, modify some of the nodes in it and then perform a selective reordering of a subset of nodes. The modification I have done without too much difficulty - extracting the current node as nodeValue, operating on the nodeValue to generate a new node with the desired structure and then replaceChild to replace the old node.

Did you know?Explore Trending and Topic pages for more stories like this.
However, when I looked at reordering I hit a stumbling block. Much to my surprise I found that there appear to be no methods of DOMNode/DOMElement/DOMDocument to help me do the reordering. I thought I would first take out the nodes that require reordering and then add them back in. And then I found that on my local installation (PHP 5.2) last_child and lastChild both produced error messages.

Am I barking up the wrong tree here? Do I need to look at something other than DOMDocument? I'd hugely appreciate any help
No comments posted yet

Your Answer:

Login to answer
237 Like 54 Dislike
Previous forums Next forums
Other forums

pointer 102 question
I read a book
1
2
3
4
5
6
7
8
9
10
11
12
int main() {

JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w

Problems with strings containing
Hey all,

I have encountered something strange in a script. I am trying to write an XML heade

MASS PM
Hello all, I'm trying to send mass private messages to users in my database but keep getting an erro

How to separate records and ORDER BY
Let say i have 100 records and displayed in one page, then i want to get the records from 50-100 and

what business processes?
Hi,

A general question. What business processes (like OTC - Order to Cach, P2P, R2R etc)

Connection Timeout
I'm using xmii 12.0

I'm calling a transaction as a web service from a windows application

How to use php and sql to check if values match the ones in a table (for logins)
How would I code it that the script takes two variables that are passed to it (UserID and PIN), and

Fatal error: Call to a member function fetchrow() on a non-object in C:xamppht
okay i have this query and everytime i add `item_id`=? to it... it gives me the error in the title..

Linked Keywords
I am trying to get a script that makes my predefined keyword converted to links and / or converted t

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash