Replacing XML nodes based on internal condition, then re-sorting
- From: Gooseman <jgabbai@xxxxxxxxx>
- Date: Fri, 28 Sep 2007 14:57:28 -0000
Hi,
I have some xml which is generated and looks something like:
<item>
--<title>Alpha</title>
--<stats>
----<rank>100</rank>
--</stats>
</item>
<item>
--<title>Beta</title>
--<stats>
----<rank>20</rank>
--</stats>
</item>
<item>
--<title>Carrot</title>
--<stats>
----<rank>12</rank>
--</stats>
</item>
What I want to do is replace the item node with the lowest rank value
with a new node:
<item>
--<title>Aardvark</title>
--<stats>
----<rank>999</rank>
--</stats>
</item>
And then resort based on the title.
I am really stuck with the best means of doing this. I've looked at
XPath for the node search, but am stumped at the best way of doing a
node replacement and then sorting based on title.
Thanks in advance!
.
- Prev by Date: Re: [PHP] [Fwd: Attachment Size and Memory limit with php and FC6 System]
- Next by Date: Installation of pear
- Previous by thread: trigger_error() problems
- Next by thread: Installation of pear
- Index(es):
Relevant Pages
|