• 목록
  • 아래로
  • 위로
  • 쓰기
  • 검색

XML 124

dqw
167 0 0

<?xml version="1.0" encoding="euc-kr"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<html>
  <head><title>XSL 연습 </title></head>
  <body>
  <center>
  <xsl:variable name="bCount" select="count(//회원)"/>
  <xsl:variable name="bTotal" select="sum(//월저축액)"/>
  <xsl:variable name="bAverage" select="$bTotal div $bCount"/>
  <h1> 주 소 록 </h1>
  <hr/>
  <table border="1">
  <tr>
       <th bgcolor="ssee11" rowspan="2"> 번호 </th>
       <th bgcolor="wwee22" rowspan="2"> 이름 </th>
       <th bgcolor="rree33" rowspan="2"> 생년월일 </th>
       <th bgcolor="ggee44" colspan="2"> 연락처 </th>
       <th bgcolor="ffee55" rowspan="2"> 월저축액 </th>
       <th bgcolor="ffee22" rowspan="2"> 나이 </th>
  </tr>
  <tr>
       <th bgcolor="eegg01"> 전화번호</th>
       <th bgcolor="eegg22"> 주소</th>
  </tr>
  <xsl:apply-templates select="주소록/회원"/>
  <tr>
  <td align="center" colspan="2">인원수</td>
  <td align="center" colspan="2"><xsl:value-of select="$bCount"/>명</td>
  <td align="center" colspan="2">월저축액 합계 :<xsl:value-of select="format-number($bTotal,'###,###')"/> 원<br/> </td>
  <td align="center" colspan="1">월저축액 평균 :<xsl:value-of select="format-number($bAverage,'###,###')"/> 원<br/> </td>

  </tr>
  </table>
  </center>
  </body>
  </html>
  </xsl:template>

 <xsl:template match="회원">
 <tr>
    <td align="center"><xsl:number/></td>
    <td><xsl:value-of select="이름"/></td>
    <td><xsl:value-of select="생일/년"/>.
        <xsl:value-of select="생일/월"/>.
        <xsl:value-of select="생일/일"/>.</td>
    <td><xsl:value-of select="연락처/전화"/></td>
    <td><xsl:value-of select="연락처/주소1"/>
        <xsl:value-of select="연락처/주소2"/></td>
    <td align="right"><xsl:value-of select="format-number(월저축액,'###,###')"/></td>
    <td align="center"><xsl:value-of select="2012-number(생일/년)"/>세</td>
 </tr>
 </xsl:template>
 </xsl:stylesheet>
 
 
   

 

신고공유스크랩

댓글 0

댓글 쓰기
권한이 없습니다. 로그인
에디터 모드

신고

"님의 댓글"

이 댓글을 신고하시겠습니까?

댓글 삭제

"님의 댓글"

이 댓글을 삭제하시겠습니까?

공유

퍼머링크

삭제

"124"

이 게시물을 삭제하시겠습니까?