-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from greystate/issue-35-modes
Issue 35 modes
- Loading branch information
Showing
15 changed files
with
151 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<x:description | ||
stylesheet="PaginationHelperCustomApplySample.xslt" | ||
xslt-version="1.0" | ||
xmlns:x="http://www.jenitennison.com/xslt/xspec" | ||
> | ||
<x:scenario label="when calling PaginateSelection"> | ||
<x:call template="PaginateSelection"> | ||
<x:param name="selection" select="document('fixtures/people-with-nicks.xml', /)//person" /> | ||
<x:param name="showPager" select="false()" /> | ||
</x:call> | ||
<x:scenario label="with the customApply parameter"> | ||
<x:call> | ||
<x:param name="customApply" select="true()" /> | ||
</x:call> | ||
<x:expect label="it should use the 'customApply'-moded template"> | ||
<p>"James Sawyer" <[email protected]></p> | ||
<p>"Kate Austen" <[email protected]></p> | ||
<p>...</p> | ||
<p>...</p> | ||
<p>"Jack Shepard" <[email protected]></p> | ||
</x:expect> | ||
</x:scenario> | ||
</x:scenario> | ||
|
||
</x:description> |
33 changes: 33 additions & 0 deletions
33
paginationhelper/test/PaginationHelperCustomApplySample.xslt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<xsl:stylesheet | ||
version="1.0" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
> | ||
|
||
<xsl:variable name="q">"</xsl:variable> | ||
|
||
<xsl:template match="/"> | ||
<body> | ||
<xsl:apply-templates /> | ||
</body> | ||
</xsl:template> | ||
|
||
<xsl:template match="people"> | ||
<xsl:call-template name="PaginateSelection"> | ||
<xsl:with-param name="customApply" select="true()" /> | ||
</xsl:call-template> | ||
</xsl:template> | ||
|
||
<xsl:template match="person"> | ||
<p> | ||
<a href="{email}"><xsl:value-of select="name" /></a> | ||
</p> | ||
</xsl:template> | ||
|
||
<xsl:template match="person" mode="customApply"> | ||
<p><xsl:value-of select="concat($q, name, $q, ' <', email, '>')" /></p> | ||
</xsl:template> | ||
|
||
<xsl:include href="../_PaginationHelper.xslt" /> | ||
|
||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,5 @@ | |
</xsl:template> | ||
|
||
<xsl:include href="../_PaginationHelper.xslt" /> | ||
|
||
|
||
|
||
</xsl:stylesheet> | ||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ | |
|
||
<xsl:include href="../_PaginationHelper.xslt" /> | ||
|
||
</xsl:stylesheet> | ||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters