Hi, I want to update part of a XML output (generated by Perl CGI). I'm
using XSL to transform the XML.
Can I use this approach?
I need to resort the contents of a table, that gives me the results
from a query, when someone clicks on one of the names of that table.
Thanks,
Bruno
I have this XML:
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xml" href="RR.xsl"?>
<!-- $Id: template.xml,v 1.5 2006/12/11 11:13:30 bcochofel Exp $ -->
<RR
xmlns:xsi="http://www.w3.org/2001/XMLSchema"
xsi:schemaLocation="http://cochofel.sytes.net
~bcochofel/iweb/files/RR.xsd">
<Request>
<url>/~bcochofel/iweb/cgi-bin/getmysites.cgi</url>
<session>
<user>g@cochofel.net</user>
</session>
<query>
<!-- o campo parametro pode ter varias ocurrencias -->
<param name="sort" value="asc" />
<param name="field" value="" />
</query>
</Request>
<Response>
<sites>
<site url="http://www.google.com">
<tag name="pesquisa" weight="30" />
<tag name="procura" weight="30" />
</site>
<site url="http://www.google.com/webhp?complete=1">
<tag name="ajax" weight="25" />
<tag name="pesquisa" weight="30" />
<tag name="procura" weight="30" />
</site>
<site url="https://webmail.fe.up.pt">
<tag name="email" weight="20" />
<tag name="feup" weight="20" />
</site>
</sites>
</Response>
</RR>
Ok, I know I can use DOM to access the XML elements and attributes
(with var x=xmlDoc.getElementsByTagName("sites");)
I want to sort <site> by url, tag/weight (inside the <site>) using
Ajax.
How can I sort by tag name attribute or tag weight attr, childs of
<site>?
Can I sort my x var like this or do I have to do some kind of
manipulation?
I'm thinking of calling a function (inside an href on the table <th>
elements) an pass a parameter to tell witch <th> was clicked, using
onClick event. I need to toggle the sorting method if the same <th> has
clicked, changing from ascending to descending...
Can I use this?