the existing code (posted above) displays the results based on the parameters put in. This all works fine.
The thing that is missing is the XSL code to paginate the results.
Pagination is when you split the results into pages and have links like "Previous, Next, page 1, page 2, page 3, page...
Using the following XSL as an exmaple, how could it be modified to include pagination of the results (ie. Previous, Next, 1,2,3,4 ) etc...
Keep in mind that I am using sorting and search parameters also.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"...
Ok I found the solution
<xsl:sort order="{$sorder}" select="
texte/fichetitre[$sterm='a'] |
texte/typeheberg[$sterm='b'] |
region/regionnseo[$sterm='c']
"/>
works 100% =)
still doesnt work, I think the problem is that $searchTerm will only work if its just the name of one element, but not if it's a full path.
any ideas on full path string variable?
so instead of including the $searchTerm I have to use the $order in the select field?
the $order value is ascending/descending
and the $searchTerm is a node item.
when I use:
<xsl:sort order="{$sorder}" select="*[name()=$searchTerm]" />
it makes the page load infinately, no error or content...
Is it possible to use a parameter as the select element in a sort tag?
<xsl:sort order="{$sorder}" select="$searchTerm"/>
Im trying to get the order based on the $searchTerm
ie.
so if $searchTerm = books/authors then in the xsl it would
sort by books/authors.
<xsl:sort order="{$sorder}"...
to select records based on one parameter
im using this
<xsl:for-each select="fiches/fiche[texte/cattouristique=$keyword]">
is it possible to pass a second parameter also?
i want to do this also
<xsl:for-each select="fiches/fiche[region/regionnseo=$keyword2]">
is there a way to combine both...
demo xml file
<books>
<book>
<title>My Book</title>
<author>
<name>Mr. McGillicuddy</name>
<dob>01.01.1901</dob>
<city>Falafel</city>
</author>
</book>
</books>
Im trying to search the books and find the name
of the authors that match the $keyword...
ok here's a revised version:
with the (working) code below
how can I sort the data based on the "fichetitre" ??
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="ISO-8859-1"...
This is what im using:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="ISO-8859-1" indent="yes"/>
<xsl:param name="keyword">none</xsl:param>
<xsl:template match="/">...
Im trying to display results based on a keyword which is working just fine.
The problem is that it shows the results found 3 times (the current total number of records).
I want it to just show the records I choose and then sort them.
heres the XSL I'm using:
<xsl:template...
Im running PHP Version 4.3.3 which uses domxml as opposed to PHP 5 which uses dom.
your code causes "Fatal error: Cannot instantiate non-existent class: DomDocument"
any ideas?
thanks!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.