include-recherche-tools.xslt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl cd67" xmlns:cd67 ="http://my.functions" >
  4. <!-- fonctionnalité cd67 pour remplacement de chaine en c# -->
  5. <msxsl:script implements-prefix="cd67" language="c#">
  6. <![CDATA[
  7. public string ReplaceChaine( string inp, string rec , string rep){
  8. return inp.Replace(rec, rep);
  9. }
  10. ]]>
  11. </msxsl:script>
  12. <xsl:template match="lst" mode="exportcustom">
  13. <div class="blocks block_rss abonner-rss">
  14. <i class="icon-"></i>
  15. <a href="/proxy/export.ashx?{$urlini}&amp;wt=xslt&amp;tr=xml2rss.xslt&amp;hl=false" target="rss">
  16. Rss
  17. </a>
  18. </div>
  19. </xsl:template>
  20. <!-- export -->
  21. <xsl:template match="lst" mode="export">
  22. <ul class="export">
  23. <li>
  24. <a href="/proxy/export.ashx?{$urlini}&amp;wt=csv">csv</a>
  25. </li>
  26. <li>
  27. <a href="/proxy/export.ashx?{$urlini}&amp;wt=xml&amp;hl=false&amp;omitHeader=true">xml</a>
  28. </li>
  29. <li>
  30. <a href="/proxy/export.ashx?{$urlini}&amp;wt=json&amp;hl=false&amp;omitHeader=true">json</a>
  31. </li>
  32. <li>
  33. <a href="/proxy/export.ashx?{$urlini}&amp;wt=xslt&amp;tr=xml2rss.xslt&amp;hl=false">rss</a>
  34. </li>
  35. </ul>
  36. </xsl:template>
  37. <!-- affichage des resultats par défaut -->
  38. <xsl:template match="doc" mode="default">
  39. <li>
  40. <ul>
  41. <xsl:apply-templates select="int|att|arr|str" mode="doc"/>
  42. </ul>
  43. </li>
  44. </xsl:template>
  45. <!-- mise en forme des élémenrs de résultats par défaut-->
  46. <xsl:template match="int|arr|str" mode="doc">
  47. <li>
  48. <strong>
  49. <xsl:value-of select="@name"/> :
  50. </strong>
  51. <xsl:value-of select="node()|descendant-or-self::node()"/>
  52. <br/>
  53. </li>
  54. </xsl:template>
  55. <!-- affichage pas de résultat -->
  56. <xsl:template name="noresult">
  57. <div class="nombre_resultat float">
  58. <p>
  59. Aucun résultat pour votre recherche : <xsl:value-of select="$query" />
  60. </p>
  61. </div>
  62. </xsl:template>
  63. <!-- fin affichage pas de résultat -->
  64. <xsl:template match="@*">
  65. <xsl:attribute name="{name()}">
  66. <xsl:value-of select="normalize-space(.)" />
  67. </xsl:attribute>
  68. </xsl:template>
  69. <xsl:template name="nl2br">
  70. <xsl:param name="contents" />
  71. <xsl:choose>
  72. <xsl:when test="contains($contents, '&#10;')">
  73. <xsl:value-of select="substring-before($contents, '&#10;')" disable-output-escaping="yes" />
  74. <br />
  75. <xsl:call-template name="nl2br">
  76. <xsl:with-param name="contents" select="substring-after($contents, '&#10;')" />
  77. </xsl:call-template>
  78. </xsl:when>
  79. <xsl:otherwise>
  80. <xsl:value-of select="$contents" disable-output-escaping="yes" />
  81. </xsl:otherwise>
  82. </xsl:choose>
  83. </xsl:template>
  84. </xsl:stylesheet>