B
bcochofel
Hi, I want to use a variable to sort elements. That var his passed with
query string (I'm using Perl CGI to generate XML).
Here's a sample of my output:
---------------------------------------------
<?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>[email protected]</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>
---------------------------------------------
I want to use the param sort and is value to sort the element <site>.
In this example:
<param name="sort" value="asc" />
so sort=asc
How can I do this? I'm new to XML, XSL and XPath...
query string (I'm using Perl CGI to generate XML).
Here's a sample of my output:
---------------------------------------------
<?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>[email protected]</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>
---------------------------------------------
I want to use the param sort and is value to sort the element <site>.
In this example:
<param name="sort" value="asc" />
so sort=asc
How can I do this? I'm new to XML, XSL and XPath...