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
<xsl:if test="record/datafield[@tag = '245'] and record/datafield/subfield[@code = 'a']"> | |
... | |
</xsl:if> |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<!-- | |
Assumes an XML document with multiple <order> elements inside a wrapping <orders> element. | |
--> | |
<!DOCTYPE xsl:stylesheet [ | |
<!-- Close your eyes and take a leap of faith! --> | |
<!ENTITY countAllOccurences "sum(ancestor::orders/order/orderLine[properties/productNumber = current()/following-sibling::productNumber]/@quantity)"> | |
]> | |
<xsl:stylesheet | |
version="1.0" |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<xsl:stylesheet | |
version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:umb="urn:umbraco.library" | |
exclude-result-prefixes="umb" | |
> | |
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> |
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
<xsl:value-of select="string-length($string) - string-length(translate($string, $char, ''))" /> |
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
function filterBy(selector) { | |
var c = selector.value, loc = document.location, q = loc.search; | |
q = addOrReplaceQueryStringParam(q, "category", c); | |
document.location = loc.pathname + q; | |
} | |
function gotoCategory(selector) { | |
var c = selector.value; | |
document.location = "/produkter?category=" + encodeURIComponent(c); | |
} |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<xsl:stylesheet | |
version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:umb="urn:umbraco.library" | |
exclude-result-prefixes="umb" | |
> | |
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> |
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
<xsl:variable name="apos"><![CDATA[']]></xsl:variable> | |
<xsl:value-of select="translate(RTEFieldName, $apos, '_')" disable-output-escaping="yes" /> |
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
<!-- Selects 'YES' if CONDITION is true() --> | |
<xsl:value-of select="substring('YES|NO', not(CONDITION) * 4 + 1, 3)" /> | |
<!-- Selects 'NO' if CONDITION is true() --> | |
<xsl:value-of select="substring('YES|NO', boolean(CONDITION) * 4 + 1, 3)" /> | |
<!-- | |
Notes: | |
* Need both versions because the longer value must be the first of the two |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Triggered by Darren Ferguson's hilarious "The Umbraco XSLT for loop" | |
(http://www.darren-ferguson.com/2011/2/22/the-umbraco-xslt-for-loop), | |
and Lee Kelleher's follow-up: http://pastebin.com/92UXcYUQ, | |
I thought I'd document the coolest way I've seen it done, which does not even use | |
recursion... only requirement is that the source document has at least as many "nodes" | |
as the loop needs. | |
(If there's too few nodes this stylesheet could be modified to use itself as "counter", |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<xsl:stylesheet | |
version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:umb="urn:umbraco.library" | |
exclude-result-prefixes="umb" | |
> | |
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> |
OlderNewer