Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 22nd, 2012  |  syntax: XML  |  size: 1.35 KB  |  views: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
  3. <xsl:stylesheet
  4.  version="1.0"
  5.  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  6.  xmlns:msxml="urn:schemas-microsoft-com:xslt"
  7.  xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
  8.  exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
  9.  
  10.  
  11. <xsl:output method="xml" omit-xml-declaration="yes"/>
  12.  
  13. <xsl:param name="currentPage"/>
  14.  
  15. <xsl:template match="/">
  16.  
  17.   <!-- gets the umbraco node -->
  18.   <xsl:variable name="testNode" select="umbraco.library:GetXmlNodeById(1000)" />
  19.  
  20.   <!-- this line errors, comment out this line to see the rest work -->
  21.   <xsl:value-of select="umbraco.library:NiceUrl($testNode/@id)" />
  22.  
  23.   <!-- this line works because of the if block -->
  24.   <xsl:if test="$testNode/@id != ''">
  25.     <xsl:value-of select="umbraco.library:NiceUrl($testNode/@id)" />
  26.   </xsl:if>
  27.  
  28. </xsl:template>
  29.  
  30. </xsl:stylesheet>