Sõitjate/mudelite ülevaade XSLT: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Akaver (talk | contribs)
No edit summary
Akaver (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<source lang="xml"><?xml version="1.0" encoding="utf-8"?>
<source lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method="html" indent="yes"/>
   <xsl:output method="html" indent="yes"/>
Line 32: Line 33:
                     <xsl:value-of select="./Producer" /> -
                     <xsl:value-of select="./Producer" /> -
                     <xsl:value-of select="./Electronics" /> -
                     <xsl:value-of select="./Electronics" /> -
                     <xsl:variable name="Freq_ID" select="./@ID" />
                    <!-- hoiame meeles sageduse ID -->
                     <xsl:variable name="Freq_ID" select="./@Freq_ID" />
                    <!-- Käime sagedused läbi-->
                     <xsl:for-each select="/EAMK/Freq_List/Frequencie">
                     <xsl:for-each select="/EAMK/Freq_List/Frequencie">
                      <!-- Kui leidus see sagedus, kuva vastav nimi-->
                       <xsl:if test="@ID = $Freq_ID">
                       <xsl:if test="@ID = $Freq_ID">
                         <xsl:value-of select="./Name" />
                         <xsl:value-of select="./Name" />

Latest revision as of 23:20, 3 April 2012

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes"/>
  <xsl:template match="/">
    <html>
      <head>
        <title>Sõitjate nimekiri</title>
      </head>
      <body>
        <h1>Sõitjate nimekiri</h1>
        <ul>
          <xsl:for-each select="/EAMK/Members/Person">
            <li>
              <div>
                Nimi:
                <xsl:value-of select="./Name" />
              </div>
              <div>
                Mail:
                <xsl:value-of select="./EMail" />
              </div>
              <div>
                Isikukood:
                <xsl:value-of select="./@SocialCode" />
              </div>
              <h4>Mudelid</h4>
              <ul>
                <xsl:for-each select="./Models/Model">
                  <li>
                    <xsl:value-of select="./Category" /> -
                    <xsl:value-of select="./Name" /> -
                    <xsl:value-of select="./Producer" /> -
                    <xsl:value-of select="./Electronics" /> -
                    <!-- hoiame meeles sageduse ID -->
                    <xsl:variable name="Freq_ID" select="./@Freq_ID" />
                    <!-- Käime sagedused läbi-->
                    <xsl:for-each select="/EAMK/Freq_List/Frequencie">
                      <!-- Kui leidus see sagedus, kuva vastav nimi-->
                      <xsl:if test="@ID = $Freq_ID">
                        <xsl:value-of select="./Name" />
                      </xsl:if>
                    </xsl:for-each>
                  </li>
                </xsl:for-each>
              </ul>
            </li>
            <br />
            <br />
          </xsl:for-each>
        </ul>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>