-
-
Save designermonkey/5099280 to your computer and use it in GitHub Desktop.
Revisions
-
designermonkey revised this gist
Mar 6, 2013 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common"> <xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" omit-xml-declaration="yes" encoding="UTF-8" indent="yes"/> <xsl:param name="user-type" select="'trade'" /> <xsl:template match="/"> <xsl:variable name="offer-merged-products"> -
designermonkey revised this gist
Mar 6, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -18,12 +18,12 @@ <xsl:choose> <xsl:when test="$user-type = 'trade'"> <xsl:apply-templates select="exsl:node-set($offer-merged-products)/product" mode="display"> <xsl:sort select="exsl:node-set($offer-merged-products)/product/trade-price" data-type="number" order="descending" /> </xsl:apply-templates> </xsl:when> <xsl:when test="$user-type = 'public'"> <xsl:apply-templates select="exsl:node-set($offer-merged-products)/product" mode="display"> <xsl:sort select="exsl:node-set($offer-merged-products)/product/public-price" data-type="number" order="descending" /> </xsl:apply-templates> </xsl:when> <xsl:otherwise> -
designermonkey revised this gist
Mar 6, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common"> <xsl:variable name="user-type" select="'trade'" /> <xsl:template match="/"> <xsl:variable name="offer-merged-products"> @@ -18,7 +18,7 @@ <xsl:choose> <xsl:when test="$user-type = 'trade'"> <xsl:apply-templates select="exsl:node-set($offer-merged-products)/product" mode="display"> <xsl:sort select="exsl:node-set($offer-merged-products)/trade-price" data-type="number" order="descending" /> </xsl:apply-templates> </xsl:when> <xsl:when test="$user-type = 'public'"> @@ -42,7 +42,7 @@ <xsl:choose> <xsl:when test="$offers-node/entry[product/item/@id=$current-product-id]"> <public-price> <xsl:value-of select="$offers-node/entry[product/item/@id=$current-product-id]/public-offer-price" /> </public-price> <trade-price> <xsl:value-of select="$offers-node/entry[product/item/@id=$current-product-id]/trade-offer-price" /> -
designermonkey revised this gist
Mar 6, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common"> <xsl:param name="user-type" select="'trade'" /> <xsl:template match="/"> <xsl:variable name="offer-merged-products"> -
designermonkey revised this gist
Mar 6, 2013 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common"> <xsl:variable name="user-type" select="'trade'" /> -
designermonkey revised this gist
Mar 6, 2013 . 1 changed file with 74 additions and 72 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,75 +1,77 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common"> <xsl:variable name="user-type" select="'trade'" /> <xsl:template match="/"> <xsl:variable name="offer-merged-products"> <xsl:apply-templates select="data/products/entry" mode="merge-prices" /> </xsl:variable> <table> <thead> <tr> <th>Product</th> <th>Price</th> </tr> </thead> <tbody> <xsl:choose> <xsl:when test="$user-type = 'trade'"> <xsl:apply-templates select="exsl:node-set($offer-merged-products)/product" mode="display"> <xsl:sort select="exsl:node-set($offer-combined-products)/trade-price" data-type="number" order="descending" /> </xsl:apply-templates> </xsl:when> <xsl:when test="$user-type = 'public'"> <xsl:apply-templates select="exsl:node-set($offer-merged-products)/product" mode="display"> <xsl:sort select="exsl:node-set($offer-merged-products)/public-price" data-type="number" order="descending" /> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <tr class="error"><td colspan="2">Unknown user type!</td></tr> </xsl:otherwise> </xsl:choose> </tbody> </table> </xsl:template> <xsl:template match="data/products/entry" mode="merge-prices"> <xsl:variable name="current-product-id" select="@id" /> <xsl:variable name="offers-node" select="/data/offers" /> <product> <name><xsl:value-of select="name"/></name> <xsl:choose> <xsl:when test="$offers-node/entry[product/item/@id=$current-product-id]"> <public-price> <xsl:value-of select="$offers-node/entry[product/item/@id=$current-product-id]/public-offer-price" /> </public-price> <trade-price> <xsl:value-of select="$offers-node/entry[product/item/@id=$current-product-id]/trade-offer-price" /> </trade-price> </xsl:when> <xsl:otherwise> <public-price><xsl:value-of select="public-price" /></public-price> <trade-price><xsl:value-of select="trade-price" /></trade-price> </xsl:otherwise> </xsl:choose> </product> </xsl:template> <xsl:template match="product" mode="display"> <tr> <td><xsl:value-of select="name"/></td> <td> <xsl:choose> <xsl:when test="$user-type = 'trade'"> <xsl:value-of select="trade-price"/> </xsl:when> <xsl:when test="$user-type = 'public'"> <xsl:value-of select="public-price"/> </xsl:when> <xsl:otherwise /> </xsl:choose> </td> </tr> </xsl:template> </xsl:stylesheet> -
designermonkey revised this gist
Mar 6, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -35,8 +35,8 @@ </xsl:template> <xsl:template match="data/products/entry" mode="merge-prices"> <xsl:variable name="current-product-id" select="@id" /> <xsl:variable name="offers-node" select="/data/offers" /> <product> <name><xsl:value-of select="name"/></name> <xsl:choose> -
s-e revised this gist
Mar 6, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ </xsl:apply-templates> </xsl:when> <xsl:otherwise> <tr class="error"><td colspan="2">Unknown user type!</td></tr> </xsl:otherwise> </xsl:choose> </tbody> -
s-e created this gist
Mar 6, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,78 @@ <?xml version="1.0" encoding="UTF-8"?> <data> <products> <entry id="1"> <name>Test</name> <public-price>10.00</public-price> <trade-price>8.00</trade-price> </entry> <entry id="2"> <name>Test</name> <public-price>10.00</public-price> <trade-price>8.00</trade-price> </entry> <entry id="3"> <name>Test</name> <public-price>10.00</public-price> <trade-price>8.00</trade-price> </entry> <entry id="4"> <name>Test</name> <public-price>10.00</public-price> <trade-price>8.00</trade-price> </entry> <entry id="5"> <name>Test</name> <public-price>10.00</public-price> <trade-price>8.00</trade-price> </entry> </products> <prices> <entry id="6"> <product> <item id="1">Test</item> </product> <public-price>15.00</public-price> <trade-price>14.00</trade-price> </entry> <entry id="7"> <product> <item id="2">Test</item> </product> <public-price>12.00</public-price> <trade-price>11.00</trade-price> </entry> <entry id="8"> <product> <item id="3">Test</item> </product> <public-price>18.00</public-price> <trade-price>15.00</trade-price> </entry> </prices> <offers> <entry id="9"> <product> <item id="1">Test</item> </product> <public-offer-price>5.00</public-offer-price> <trade-offer-price>4.00</trade-offer-price> </entry> <entry id="10"> <product> <item id="3">Test</item> </product> <public-offer-price>6.00</public-offer-price> <trade-offer-price>5.00</trade-offer-price> </entry> <entry id="11"> <product> <item id="4">Test</item> </product> <public-offer-price>7.00</public-offer-price> <trade-offer-price>6.00</trade-offer-price> </entry> </offers> </data> This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,75 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common"> <xsl:template match="/"> <xsl:variable name="offer-merged-products"> <xsl:apply-templates select="data/products/entry" mode="merge-prices" /> </xsl:variable> <table> <thead> <tr> <th>Product</th> <th>Price</th> </tr> </thead> <tbody> <xsl:choose> <xsl:when test="$user-type = 'trade'"> <xsl:apply-templates select="exsl:node-set($offer-merged-products)/product" mode="display"> <xsl:sort select="exsl:node-set($offer-combined-products)/trade-price" data-type="number" order="descending" /> </xsl:apply-templates> </xsl:when> <xsl:when test="$user-type = 'public'"> <xsl:apply-templates select="exsl:node-set($offer-merged-products)/product" mode="display"> <xsl:sort select="exsl:node-set($offer-merged-products)/public-price" data-type="number" order="descending" /> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <tr class="error"><td colspan=2>Unknown user type!</td></tr> </xsl:otherwise> </xsl:choose> </tbody> </table> </xsl:template> <xsl:template match="data/products/entry" mode="merge-prices"> <xsl:variable name="$current-product-id" select="@id" /> <xsl:variable name="$offers-node" select="/data/offers" /> <product> <name><xsl:value-of select="name"/></name> <xsl:choose> <xsl:when test="$offers-node/entry[product/item/@id=$current-product-id]"> <public-price> <xsl:value-of select="$offers-node/entry[product/item/@id=$current-product-id]/public-offer-price" /> </public-price> <trade-price> <xsl:value-of select="$offers-node/entry[product/item/@id=$current-product-id]/trade-offer-price" /> </trade-price> </xsl:when> <xsl:otherwise> <public-price><xsl:value-of select="public-price" /></public-price> <trade-price><xsl:value-of select="trade-price" /></trade-price> </xsl:otherwise> </xsl:choose> </product> </xsl:template> <xsl:template match="product" mode="display"> <tr> <td><xsl:value-of select="name"/></td> <td> <xsl:choose> <xsl:when test="$user-type = 'trade'"> <xsl:value-of select="trade-price"/> </xsl:when> <xsl:when test="$user-type = 'public'"> <xsl:value-of select="public-price"/> </xsl:when> <xsl:otherwise /> </xsl:choose> </td> </tr> </xsl:template> </xsl:stylesheet>