github.com/matislovas/ratago@v0.0.0-20240408115641-cc0857415a7a/xslt/testdata/general/bug-117.xsl (about)

     1  <?xml version="1.0"?>
     2  
     3  <xsl:stylesheet version="1.0"
     4                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     5                  xmlns:l="http://www.foobar.com/xmlns/l"
     6                  xmlns:s="http://www.foobar.com/xmlns/s"
     7                  xmlns:exsl="http://exslt.org/common"
     8                  exclude-result-prefixes="l"
     9                  extension-element-prefixes="exsl"
    10  >
    11  
    12  <xsl:output method="html" media-type="text/html" encoding="ISO-8859-1" />
    13  
    14  <xsl:template match="/">
    15          <xsl:apply-templates select="l:doc" />
    16  </xsl:template>
    17  
    18  <xsl:template match="l:doc">
    19          <s:doc>
    20                  <xsl:for-each select="@*">
    21                          <xsl:attribute name="{name()}"><xsl:value-of
    22  select="."/></xsl:attribute>
    23                  </xsl:for-each>
    24                  <s:doc-head>
    25                          <xsl:apply-templates select="l:doc-head"/>
    26                  </s:doc-head>
    27                  <s:doc-body>
    28                          <s:div class="header">
    29                                  <s:a href="/">
    30                                          <s:img
    31  src="/images/logo/mylogo.jpg" width="200" height="100" border="0"
    32  title="LOGO" alt="LOGO"/>
    33                                  </s:a>
    34                          </s:div>
    35                          <s:br/>
    36                          <s:div class="body">
    37                                  <xsl:apply-templates select="l:doc-content"/>
    38                          </s:div>
    39                  </s:doc-body>
    40          </s:doc>
    41  </xsl:template>
    42  
    43  <xsl:template match="l:doc-title">
    44          <s:doc-title><xsl:apply-templates/></s:doc-title>
    45  </xsl:template>
    46  
    47  <!-- some HTML-like elements -->
    48  <xsl:template
    49  match="l:a|l:abbr|l:acronym|l:address|l:area|l:b|l:base|l:bdo|l:big|l:blockquote|l:body|l:br|l:button|l:caption|l:cite|l:code|l:col|l:colgroup|l:dd|l:del|l:dfn|l:div|l:dl|l:dt|l:em|l:fieldset|l:form|l:frame|l:framset|l:h1|l:h2|l:h3|l:h4|l:h5|l:h6|l:head|l:hr|l:i|l:iframe|l:img|l:input|l:ins|l:kbd|l:label|l:legend|l:li|l:link|l:map|l:noframes|l:noscript|l:object|l:ol|l:optgroup|l:option|l:p|l:param|l:pre|l:q|l:samp|l:script|l:select|l:small|l:span|l:strong|l:style|l:sub|l:sup|l:table|l:tbody|l:td|l:textarea|l:tfoot|l:th|l:thead|l:tr|l:tt|l:ul|l:var">
    50          <xsl:element name="s:{local-name()}">
    51                  <xsl:for-each select="@*">
    52                          <xsl:attribute name="{name()}"><xsl:value-of
    53  select="." /></xsl:attribute>
    54                  </xsl:for-each>
    55                  <xsl:apply-templates />
    56          </xsl:element>
    57  </xsl:template>
    58  
    59  </xsl:stylesheet>