home *** CD-ROM | disk | FTP | other *** search
/ 11 Top Anwendungen / CD_ROM_MAGAZIN.iso / MoneyMethod-Demo / Beispiel / source / XML / READSTYL.XSL < prev    next >
Encoding:
Extensible Markup Language  |  2000-05-29  |  20.1 KB  |  387 lines

  1. <xsl:stylesheet
  2.   version="1.0"
  3.   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.   xmlns:xt="http://www.jclark.com/xt">
  5. <xsl:output method="html"/>
  6. <xsl:strip-space elements="*"/>
  7.  
  8.  
  9. <xsl:variable name="st"          select="document("styles.xml")/params"/>
  10. <xsl:variable name="startpages-st"    select="$st//paramgroup[@name="startpages"]"/>
  11. <xsl:variable name="general-st"    select="document('params.xml')//paramgroup[@name="general"]"/>
  12. <xsl:variable name="frame-st"    select="$st//paramgroup[@name="frames"]"/>
  13. <xsl:variable name="uframe-st"   select="$frame-st/paramgroup[@name="uframe"]"/>
  14. <xsl:variable name="lframe-st"   select="$frame-st/paramgroup[@name="lframe"]"/>
  15. <xsl:variable name="index-st"    select="$st//paramgroup[@name="index"]"/>
  16. <xsl:variable name="index-font-st" select="$index-st//paramgroup[@name="font"]"/>
  17. <xsl:variable name="page-st"     select="$st//paramgroup[@name="page"]"/>
  18. <xsl:variable name="table-st"    select="$st//paramgroup[@name="table"]"/>
  19. <xsl:variable name="row-st"      select="$st//paramgroup[@name="rows"]"/>
  20. <xsl:variable name="row-font-st" select="$row-st/paramgroup[@name="font"]"/>
  21. <xsl:variable name="header-st"   select="$st//paramgroup[@name="header"]"/>
  22. <xsl:variable name="header-font-st" select="$header-st/paramgroup[@name="font"]"/>
  23. <xsl:variable name="caption-st"   select="$st//paramgroup[@name="caption"]"/>
  24. <xsl:variable name="caption-font-st" select="$caption-st/paramgroup[@name="font"]"/>
  25.  
  26. <xsl:variable name="card-st" select="$st/paramgroup[@name="card"]"/>
  27. <xsl:variable name="title-st" select="$card-st/paramgroup[@name="title"]"/>
  28. <xsl:variable name="title-font-st" select="$title-st/paramgroup[@name="font"]"/>
  29. <xsl:variable name="author-st" select="$card-st/paramgroup[@name="author"]"/>
  30. <xsl:variable name="author-font-st" select="$author-st/paramgroup[@name="font"]"/>
  31. <xsl:variable name="pilab-st" select="$card-st/paramgroup[@name="pilab"]"/>
  32. <xsl:variable name="pilab-font-st" select="$pilab-st/paramgroup[@name="font"]"/>
  33. <xsl:variable name="pival-st" select="$card-st/paramgroup[@name="pival"]"/>
  34. <xsl:variable name="pival-font-st" select="$pival-st/paramgroup[@name="font"]"/>
  35. <xsl:variable name="desclab-st" select="$card-st/paramgroup[@name="desclab"]"/>
  36. <xsl:variable name="desclab-font-st" select="$desclab-st/paramgroup[@name="font"]"/>
  37. <xsl:variable name="desctext-st" select="$card-st/paramgroup[@name="desctext"]"/>
  38. <xsl:variable name="desctext-font-st" select="$desctext-st/paramgroup[@name="font"]"/>
  39.  
  40. <xsl:template name="apply-bold">
  41.   <xsl:param name="isbold"/>
  42.   <xsl:param name="content"/>
  43.     <xsl:choose>
  44.     <xsl:when test="$isbold="true" or $isbold="yes"">
  45.         <b><xsl:copy-of select="$content"/></b>
  46.     </xsl:when>
  47.     <xsl:otherwise>
  48.         <xsl:copy-of select="$content"/>
  49.     </xsl:otherwise>
  50.     </xsl:choose>
  51. </xsl:template>
  52.  
  53. <xsl:template name="apply-italic">
  54.   <xsl:param name="isitalic"/>
  55.   <xsl:param name="content"/>
  56.     <xsl:choose>
  57.     <xsl:when test="$isitalic="true" or $isitalic="yes"" >
  58.         <i><xsl:copy-of select="$content"/></i>
  59.     </xsl:when>
  60.     <xsl:otherwise>
  61.         <xsl:copy-of select="$content"/>
  62.     </xsl:otherwise>
  63.     </xsl:choose>
  64. </xsl:template>
  65.  
  66. <xsl:template name="apply-striked">
  67.   <xsl:param name="isstriked"/>
  68.   <xsl:param name="content"/>
  69.     <xsl:choose>
  70.     <xsl:when test="$isstriked="yes" or $isstriked="true"">
  71.         <s><xsl:copy-of select="$content"/></s>
  72.     </xsl:when>
  73.     <xsl:otherwise>
  74.         <xsl:copy-of select="$content"/>
  75.     </xsl:otherwise>
  76.     </xsl:choose>
  77. </xsl:template>
  78.  
  79. <xsl:template name="apply-font-styles">
  80.   <xsl:param name="bold"/>
  81.   <xsl:param name="italic"/>
  82.   <xsl:param name="striked"/>
  83.   <xsl:param name="content"/>
  84.  
  85.   <xsl:call-template name="apply-italic">
  86.      <xsl:with-param name="isitalic" select="$italic"/>
  87.      <xsl:with-param name="content">
  88.        <xsl:call-template name="apply-bold">
  89.        <xsl:with-param name="isbold" select="$bold"/>
  90.        <xsl:with-param name="content">
  91.          <xsl:call-template name="apply-striked">
  92.          <xsl:with-param name="isstriked" select="$striked"/>
  93.          <xsl:with-param name="content">
  94.            <xsl:copy-of select="$content"/>
  95.          </xsl:with-param>
  96.        </xsl:call-template> <!-- striked -->
  97.        </xsl:with-param>
  98.        </xsl:call-template> <!-- bold   -->
  99.      </xsl:with-param>
  100.   </xsl:call-template>      <!-- italic -->
  101. </xsl:template>
  102.  
  103.  
  104. <xsl:variable name="rowsperpage" select="$table-st/param[@name='rowsperpage']/@value"/>
  105. <xsl:variable name="table-width" select="$table-st/param[@name='width']/@value"/>
  106.  
  107. <xsl:template name="apply-font-styles-using-path">
  108.   <xsl:param name="path"/>
  109.   <xsl:param name="content"/>
  110.  
  111.   <xsl:variable name="bold"
  112. select="$path/paramgroup[@name="font"]/param[@name="bold"]/@value"/>
  113.   <xsl:variable name="italic"
  114. select="$path/paramgroup[@name="font"]/param[@name="italic"]/@value"/>
  115.   <xsl:variable name="striked"
  116. select="$path/paramgroup[@name="font"]/param[@name="striked"]/@value"/>
  117.   <xsl:call-template name="apply-font-styles">
  118.     <xsl:with-param name="content" select="$content"/>
  119.     <xsl:with-param name="bold" select="$bold"/>
  120.     <xsl:with-param name="italic" select="$italic"/>
  121.     <xsl:with-param name="striked" select="$striked"/>
  122.   </xsl:call-template>
  123. </xsl:template>
  124.  
  125. <xsl:variable name="mpcolor1" select="$startpages-st/param[@name='color1']/@value"/>
  126. <xsl:variable name="mpcolor2" select="$startpages-st/param[@name='color2']/@value"/>
  127. <xsl:variable name="mpcolor3" select="$startpages-st/param[@name='color3']/@value"/>
  128.  
  129. <xsl:attribute-set name="index-font-style">
  130.  <xsl:attribute name="size"><xsl:value-of select="$index-font-st/param[@name='size']/@value"/></xsl:attribute>
  131.  <xsl:attribute name="face"><xsl:value-of select="$index-font-st/param[@name='family']/@value"/></xsl:attribute>
  132.  <xsl:attribute name="color"><xsl:value-of select="$index-font-st/param[@name="color"]/@value"/></xsl:attribute>
  133. </xsl:attribute-set>
  134.  
  135. <xsl:attribute-set name="row-font-style">
  136.  <xsl:attribute name="size"><xsl:value-of select="$row-font-st/param[@name='size']/@value"/></xsl:attribute>
  137.  <xsl:attribute name="face"><xsl:value-of select="$row-font-st/param[@name='family']/@value"/></xsl:attribute>
  138.  <xsl:attribute name="color"><xsl:value-of select="$row-font-st/param[@name="color"]/@value"/></xsl:attribute>
  139. </xsl:attribute-set>
  140.  
  141. <xsl:attribute-set name="header-font-style">
  142.  <xsl:attribute name="size"><xsl:value-of select="$header-font-st/param[@name='size']/@value"/></xsl:attribute>
  143.  <xsl:attribute name="face"><xsl:value-of select="$header-font-st/param[@name='family']/@value"/></xsl:attribute>
  144.  <xsl:attribute name="color"><xsl:value-of select="$header-font-st/param[@name="color"]/@value"/></xsl:attribute>
  145. </xsl:attribute-set>
  146.  
  147. <xsl:attribute-set name="caption-font-style">
  148.  <xsl:attribute name="size"><xsl:value-of select="$caption-font-st/param[@name='size']/@value"/></xsl:attribute>
  149.  <xsl:attribute name="face"><xsl:value-of select="$caption-font-st/param[@name='family']/@value"/></xsl:attribute>
  150.  <xsl:attribute name="color"><xsl:value-of select="$caption-font-st/param[@name="color"]/@value"/></xsl:attribute>
  151. </xsl:attribute-set>
  152.  
  153. <xsl:attribute-set name="title-font-style">
  154.  <xsl:attribute name="size"><xsl:value-of select="$title-font-st/param[@name='size']/@value"/></xsl:attribute>
  155.  <xsl:attribute name="face"><xsl:value-of select="$title-font-st/param[@name='family']/@value"/></xsl:attribute>
  156.  <xsl:attribute name="color"><xsl:value-of select="$title-font-st/param[@name="color"]/@value"/></xsl:attribute>
  157. </xsl:attribute-set>
  158.  
  159. <xsl:attribute-set name="author-font-style">
  160.  <xsl:attribute name="size"><xsl:value-of select="$author-font-st/param[@name='size']/@value"/></xsl:attribute>
  161.  <xsl:attribute name="face"><xsl:value-of select="$author-font-st/param[@name='family']/@value"/></xsl:attribute>
  162.  <xsl:attribute name="color"><xsl:value-of select="$author-font-st/param[@name="color"]/@value"/></xsl:attribute>
  163. </xsl:attribute-set>
  164.  
  165. <xsl:attribute-set name="pilab-font-style">
  166.  <xsl:attribute name="size"><xsl:value-of select="$pilab-font-st/param[@name='size']/@value"/></xsl:attribute>
  167.  <xsl:attribute name="face"><xsl:value-of select="$pilab-font-st/param[@name='family']/@value"/></xsl:attribute>
  168.  <xsl:attribute name="color"><xsl:value-of select="$pilab-font-st/param[@name="color"]/@value"/></xsl:attribute>
  169. </xsl:attribute-set>
  170.  
  171. <xsl:attribute-set name="pival-font-style">
  172.  <xsl:attribute name="size"><xsl:value-of select="$pival-font-st/param[@name='size']/@value"/></xsl:attribute>
  173.  <xsl:attribute name="face"><xsl:value-of select="$pival-font-st/param[@name='family']/@value"/></xsl:attribute>
  174.  <xsl:attribute name="color"><xsl:value-of select="$pival-font-st/param[@name="color"]/@value"/></xsl:attribute>
  175. </xsl:attribute-set>
  176.  
  177. <xsl:attribute-set name="desclab-font-style">
  178.  <xsl:attribute name="size"><xsl:value-of select="$desclab-font-st/param[@name='size']/@value"/></xsl:attribute>
  179.  <xsl:attribute name="face"><xsl:value-of select="$desclab-font-st/param[@name='family']/@value"/></xsl:attribute>
  180.  <xsl:attribute name="color"><xsl:value-of select="$desclab-font-st/param[@name="color"]/@value"/></xsl:attribute>
  181. </xsl:attribute-set>
  182.  
  183. <xsl:attribute-set name="desctext-font-style">
  184.  <xsl:attribute name="size"><xsl:value-of select="$desctext-font-st/param[@name='size']/@value"/></xsl:attribute>
  185.  <xsl:attribute name="face"><xsl:value-of select="$desctext-font-st/param[@name='family']/@value"/></xsl:attribute>
  186.  <xsl:attribute name="color"><xsl:value-of select="$desctext-font-st/param[@name="color"]/@value"/></xsl:attribute>
  187. </xsl:attribute-set>
  188.  
  189. <xsl:template name="decode-align">
  190.   <xsl:param name="code"/>
  191.  
  192. <xsl:choose>
  193.   <xsl:when test="$code = 1">left</xsl:when>
  194.   <xsl:when test="$code = 2">center</xsl:when>
  195.   <xsl:when test="$code = 3">right</xsl:when>
  196. </xsl:choose>
  197.  
  198. </xsl:template>
  199.  
  200.  
  201. <xsl:template name="decode-vert-align">
  202.   <xsl:param name="code"/>
  203.  
  204. <xsl:choose>
  205.   <xsl:when test="$code = 1">top</xsl:when>
  206.   <xsl:when test="$code = 2">bottom</xsl:when>
  207. </xsl:choose>
  208.  
  209. </xsl:template>
  210.  
  211.  
  212. <xsl:attribute-set name="author-align">
  213.     <xsl:attribute name="align">
  214.        <xsl:call-template name="decode-align">
  215.           <xsl:with-param name="code"><xsl:value-of select="$author-st/param[@name="align"]/@value"/>
  216.           </xsl:with-param> 
  217.        </xsl:call-template>
  218.     </xsl:attribute>
  219. </xsl:attribute-set>
  220.  
  221. <xsl:attribute-set name="pilab-align">
  222.     <xsl:attribute name="align">
  223.        <xsl:call-template name="decode-align">
  224.           <xsl:with-param name="code"><xsl:value-of select="$pilab-st/param[@name="align"]/@value"/>
  225.           </xsl:with-param> 
  226.        </xsl:call-template>
  227.     </xsl:attribute>
  228. </xsl:attribute-set>
  229.  
  230. <xsl:attribute-set name="pival-align">
  231.     <xsl:attribute name="align">
  232.        <xsl:call-template name="decode-align">
  233.           <xsl:with-param name="code"><xsl:value-of select="$pival-st/param[@name="align"]/@value"/>
  234.           </xsl:with-param> 
  235.        </xsl:call-template>
  236.        </xsl:attribute>
  237. </xsl:attribute-set>
  238.  
  239. <xsl:attribute-set name="desclab-align">
  240.     <xsl:attribute name="align">
  241.     <xsl:call-template name="decode-align">
  242.           <xsl:with-param name="code"><xsl:value-of select="$desclab-st/param[@name="align"]/@value"/>
  243.           </xsl:with-param> 
  244.        </xsl:call-template>
  245.     </xsl:attribute>
  246. </xsl:attribute-set>
  247.  
  248. <xsl:attribute-set name="desctext-align">
  249.     <xsl:attribute name="align">
  250.     <xsl:call-template name="decode-align">
  251.           <xsl:with-param name="code"><xsl:value-of select="$desctext-st/param[@name="align"]/@value"/>
  252.           </xsl:with-param> 
  253.        </xsl:call-template>
  254.     </xsl:attribute>
  255. </xsl:attribute-set>
  256.  
  257. <xsl:attribute-set name="caption-align">
  258.     <xsl:attribute name="align">
  259.     <xsl:call-template name="decode-align">
  260.           <xsl:with-param name="code"><xsl:value-of select="$caption-st/param[@name="horalign"]/@value"/>
  261.           </xsl:with-param> 
  262.        </xsl:call-template>
  263.     </xsl:attribute>
  264. </xsl:attribute-set>
  265.  
  266. <xsl:attribute-set name="price-align">
  267.     <xsl:attribute name="align">
  268.     <xsl:call-template name="decode-align">
  269.           <xsl:with-param name="code"><xsl:value-of select="$row-st/param[@name="pricealign"]/@value"/>
  270.           </xsl:with-param> 
  271.        </xsl:call-template>
  272.     </xsl:attribute>
  273. </xsl:attribute-set>
  274.  
  275. <xsl:attribute-set name="title-align">
  276.     <xsl:attribute name="align">
  277.     <xsl:call-template name="decode-align">
  278.           <xsl:with-param name="code"><xsl:value-of select="$row-st/param[@name="titlealign"]/@value"/>
  279.           </xsl:with-param> 
  280.        </xsl:call-template>
  281.     </xsl:attribute>
  282. </xsl:attribute-set>
  283.  
  284. <xsl:attribute-set name="caption-vert-align">
  285.     <xsl:attribute name="align">
  286.     <xsl:call-template name="decode-vert-align">
  287.           <xsl:with-param name="code"><xsl:value-of select="$caption-st/param[@name="vertalign"]/@value"/>
  288.           </xsl:with-param> 
  289.        </xsl:call-template>
  290.     </xsl:attribute>
  291. </xsl:attribute-set>
  292.  
  293. <xsl:attribute-set name="row-style">
  294.     <xsl:attribute name="bgcolor"><xsl:if test="position() mod 2 = 1"><xsl:value-of select="$row-st/param[@name="color1"]/@value"/>
  295.        </xsl:if>
  296.        <xsl:if test="position() mod 2 != 1"><xsl:value-of select="$row-st/param[@name="color2"]/@value"/>
  297.        </xsl:if>
  298.     </xsl:attribute>
  299.     <xsl:attribute name="align"><xsl:value-of select="$row-st/param[@name="align"]/@value"/></xsl:attribute>
  300. </xsl:attribute-set>
  301.  
  302. <xsl:variable name="tablecolor1" select="$row-st/param[@name="color1"]/@value"/>
  303. <xsl:variable name="tablecolor2" select="$row-st/param[@name="color2"]/@value"/>
  304.  
  305. <xsl:attribute-set name="header-style">
  306.     <xsl:attribute name="bgcolor"><xsl:value-of select="$header-st/param[@name="bgcolor"]/@value"/></xsl:attribute>
  307.     <xsl:attribute name="align"><xsl:call-template name="decode-align">
  308.           <xsl:with-param name="code"><xsl:value-of select="$header-st/param[@name="horalign"]/@value"/>
  309.           </xsl:with-param> 
  310.        </xsl:call-template>
  311.     </xsl:attribute>
  312. </xsl:attribute-set>
  313.  
  314.  
  315. <xsl:variable name="tablebgcolor"><xsl:value-of select="$table-st/param[@name="bgcolor"]/@value"/></xsl:variable>
  316.  
  317. <xsl:attribute-set name="table-style">
  318.     <xsl:attribute name="bgcolor"><xsl:value-of select="$table-st/param[@name="bgcolor"]/@value"/></xsl:attribute>
  319.     <xsl:attribute name="align">
  320.        <xsl:call-template name="decode-align">
  321.           <xsl:with-param name="code"><xsl:value-of select="$table-st/param[@name="align"]/@value"/>
  322.           </xsl:with-param> 
  323.        </xsl:call-template>
  324.     </xsl:attribute>
  325.     <xsl:attribute name="width"><xsl:value-of select="$table-st/param[@name="width"]/@value"/></xsl:attribute>
  326.     <xsl:attribute name="cellspacing"><xsl:value-of select="$table-st/param[@name="cellspacing"]/@value"/></xsl:attribute>
  327.     <xsl:attribute name="cellpadding"><xsl:value-of select="$table-st/param[@name="cellpadding"]/@value"/></xsl:attribute>
  328.     <xsl:attribute name="border"><xsl:value-of select="$table-st/param[@name="border"]/@value"/></xsl:attribute>
  329.     <xsl:attribute name="bordersize"><xsl:value-of select="$table-st/param[@name="borderwidth"]/@value"/></xsl:attribute>
  330. </xsl:attribute-set>
  331.  
  332.  
  333. <xsl:variable name="pagebgcolor"><xsl:value-of select="$page-st/param[@name="bgcolor"]/@value"/></xsl:variable>
  334. <xsl:variable name="table-align"><xsl:call-template name="decode-align">
  335.     <xsl:with-param name="code"><xsl:value-of select="$table-st/param[@name="align"]/@value"/>
  336.         </xsl:with-param> 
  337.     </xsl:call-template>
  338. </xsl:variable>
  339.  
  340. <xsl:attribute-set name="page-style">
  341.     <xsl:attribute name="bgcolor"><xsl:value-of select="$page-st/param[@name="bgcolor"]/@value"/></xsl:attribute>
  342.     <xsl:attribute name="background"><xsl:value-of select="$page-st/param[@name="bgimage"]/@value"/></xsl:attribute>
  343.     <xsl:attribute name="link"><xsl:value-of select="$page-st/param[@name="lcolor"]/@value"/></xsl:attribute>
  344.     <xsl:attribute name="alink"><xsl:value-of select="$page-st/param[@name="alcolor"]/@value"/></xsl:attribute>
  345.     <xsl:attribute name="vlink"><xsl:value-of select="$page-st/param[@name="vlcolor"]/@value"/></xsl:attribute>
  346. </xsl:attribute-set>
  347.  
  348. <xsl:attribute-set name="index-style">
  349.     <xsl:attribute name="bgcolor"><xsl:value-of select="$index-st/param[@name="bgcolor"]/@value"/></xsl:attribute>
  350.     <xsl:attribute name="background"><xsl:value-of select="$index-st/param[@name="bgimage"]/@value"/></xsl:attribute>
  351.     <xsl:attribute name="link"><xsl:value-of select="$index-st/param[@name="lcolor"]/@value"/></xsl:attribute>
  352.     <xsl:attribute name="alink"><xsl:value-of select="$index-st/param[@name="alcolor"]/@value"/></xsl:attribute>
  353.     <xsl:attribute name="vlink"><xsl:value-of select="$index-st/param[@name="vlcolor"]/@value"/></xsl:attribute>
  354. </xsl:attribute-set>
  355.  
  356. <xsl:attribute-set name="card-style">
  357.     <xsl:attribute name="bgcolor"><xsl:value-of select="$card-st/param[@name="bgcolor"]/@value"/></xsl:attribute>
  358.     <xsl:attribute name="background"><xsl:value-of select="$card-st/param[@name="bgimage"]/@value"/></xsl:attribute>
  359.     <xsl:attribute name="link"><xsl:value-of select="$card-st/param[@name="lcolor"]/@value"/></xsl:attribute>
  360.     <xsl:attribute name="alink"><xsl:value-of select="$card-st/param[@name="alcolor"]/@value"/></xsl:attribute>
  361.     <xsl:attribute name="vlink"><xsl:value-of select="$card-st/param[@name="vlcolor"]/@value"/></xsl:attribute>
  362. </xsl:attribute-set>
  363.  
  364.  
  365. <xsl:variable name="pricecol"><xsl:value-of select="document("dblinks.xml")/params/price"/></xsl:variable>
  366. <xsl:variable name="isbncol"><xsl:value-of select="document("dblinks.xml")/params/ISBN"/></xsl:variable>
  367. <xsl:variable name="titlecol"><xsl:value-of select="document("dblinks.xml")/params/Title"/></xsl:variable>
  368. <xsl:variable name="desccol"><xsl:value-of select="document("dblinks.xml")/params/Annot"/></xsl:variable>
  369. <xsl:variable name="imagecol"><xsl:value-of select="document("dblinks.xml")/params/Imagecol"/></xsl:variable>
  370. <xsl:variable name="authorcol"><xsl:value-of select="document("dblinks.xml")/params/Author"/></xsl:variable>
  371.  
  372. <xsl:variable name="email"><xsl:value-of select="$general-st/param[@name='email']/@value"/></xsl:variable>
  373. <xsl:variable name="serv"><xsl:value-of select="$general-st/param[@name='serverloc']/@value"/></xsl:variable>
  374. <xsl:variable name="semail"><xsl:value-of select="$general-st/param[@name='semail']/@value"/></xsl:variable>
  375. <xsl:variable name="sendmethod"><xsl:value-of select="$general-st/param[@name='sendmethod']/@value"/></xsl:variable>
  376. <xsl:variable name="sendprice"><xsl:value-of select="$general-st/param[@name='sendprice']/@value"/></xsl:variable>
  377. <xsl:variable name="currency"><xsl:value-of select="$general-st/param[@name='currency']/@value"/></xsl:variable>
  378. <xsl:variable name="rate"><xsl:value-of select="$general-st/param[@name='rate']/@value"/></xsl:variable>
  379. <xsl:variable name="max-items"><xsl:value-of select="$general-st/param[@name='max-items']/@value"/></xsl:variable>
  380.  
  381. <xsl:variable name="server">
  382.     <xsl:if test="starts-with($serv,'http://') = false()"><xsl:value-of select="concat ('http://', $serv)"/></xsl:if>
  383.     <xsl:if test="starts-with($serv,'http://') = true()"><xsl:value-of select="$serv"/></xsl:if>
  384. </xsl:variable>
  385.  
  386. </xsl:stylesheet>
  387.