Text unit sample.xsl: 두 판 사이의 차이

Classics Wiki
편집 요약 없음
편집 요약 없음
 
(같은 사용자의 중간 판 9개는 보이지 않습니다)
1번째 줄: 1번째 줄:
<?xml version="1.0" encoding="UTF-8"?>
<?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" encoding="utf-8"/>
     <xsl:output method="html" encoding="UTF-8" indent="yes"/>


     <xsl:template match="/">
     <xsl:template match="/text_unit">
         <html lang="ko">
         <div class="text-unit-container" style="font-family: 'Noto Serif KR', serif; line-height: 1.8; padding: 20px;">
            <head>
            <h2 style="border-bottom: 2px solid #333; padding-bottom: 5px;">
                <meta charset="UTF-8"/>
                 ID: <xsl:value-of select="@id"/>
                <title>용어사전 스타일 쉬트</title>
             </h2>
                <style>
           
                    table { border-collapse: collapse; width: 96%; margin-left:10px; margin-right-10px; margin-bottom: 2em; table-layout: fixed; }
             <xsl:apply-templates select="hanmun_text"/>
                    th, td { border: 1px solid #ccc; padding: 8px; text-align: left; }
            <xsl:apply-templates select="glossary"/>
                    th { background-color: #f2f2f2; }
             <xsl:apply-templates select="translation"/>
                    .section { margin-bottom: 30px; }
         </div>
                 </style>
             </head>
             <body>
                <xsl:template match="/text_unit">
             </body>
         </html>
     </xsl:template>
     </xsl:template>


     <xsl:template match="hanmun_text | translation">
     <xsl:template match="hanmun_text | translation">
         <div class="content-unit">
         <!-- <div style="margin-top: 20px; padding: 15px; background-color: #f9f9f9; border-left: 5px solid #ccc;"> -->
            <xsl:apply-templates/>
            <strong style="display:block; margin-bottom: 10px; color: #555;">
         </div>
                [<xsl:value-of select="name()"/>]
            </strong>
            <!-- <div class="content-body" style="font-size: 1.1em; white-space: pre-wrap;"> -->
                <xsl:apply-templates/>
            <!-- </div> -->
         <!-- </div> -->
     </xsl:template>
     </xsl:template>


     <xsl:template match="glossary">
     <xsl:template match="glossary">
         <div class="content-unit">
         <div style="margin-top: 30px;">
                 <table>
            <strong style="display:block; margin-bottom: 10px; color: #555;">[glossary]</strong>
                     <thead>
            <table style="width:100%; border-collapse: collapse; table-layout: fixed; font-size: 0.95em;">
                 <thead>
                    <tr style="background-color: #eee; border-top: 2px solid #333; border-bottom: 1px solid #333;">
                        <th style="width:10%; padding: 8px; border: 1px solid #ddd;">type</th>
                        <th style="width:10%; padding: 8px; border: 1px solid #ddd;">hanmun</th>
                        <th style="width:10%; padding: 8px; border: 1px solid #ddd;">korean</th>
                        <th style="width:10%; padding: 8px; border: 1px solid #ddd;">scope</th>
                        <th style="width:30%; padding: 8px; border: 1px solid #ddd;">definition</th>
                        <th style="width:30%; padding: 8px; border: 1px solid #ddd;">sense_note</th>
                     </tr>
                </thead>
                <tbody>
                    <xsl:for-each select="term">
                         <tr>
                         <tr>
                             <th style="width:10%">type</th>
                             <td style="padding: 8px; border: 1px solid #ddd; text-align:center;"><xsl:value-of select="@type"/></td>
                             <th style="width:10%">hanmun</th>
                             <td style="padding: 8px; border: 1px solid #ddd; font-weight:bold;"><xsl:value-of select="lemma/hanmun"/></td>
                             <th style="width:10%">korean</th>
                             <td style="padding: 8px; border: 1px solid #ddd;"><xsl:value-of select="lemma/korean"/></td>
                             <th style="width:10%">scope</th>
                             <td style="padding: 8px; border: 1px solid #ddd; text-align:center;"><xsl:value-of select="sense/@scope"/></td>
                             <th style="width:30%">definition</th>
                             <td style="padding: 8px; border: 1px solid #ddd;"><xsl:value-of select="sense/definition"/></td>
                             <th style="width:30%">sense_note</th>
                             <td style="padding: 8px; border: 1px solid #ddd; color: #666; font-style: italic;"><xsl:value-of select="sense/sense_note"/></td>
                         </tr>
                         </tr>
                     </thead>
                     </xsl:for-each>
                    <tbody>
                </tbody>
                        <xsl:apply-templates select="glossary/term"/>
            </table>
                    </tbody>
            <br/>
                </table>
         </div>
         </div>
    </xsl:template>
    <xsl:template match="term">
        <tr>
            <td><xsl:value-of select="@type"/></td>
            <td><xsl:value-of select="lemma/hanmun"/></td>
            <td><xsl:value-of select="lemma/korean"/></td>
            <td><xsl:value-of select="sense/@scope"/></td>
            <td><xsl:value-of select="sense/definition"/></td>
            <td><xsl:value-of select="sense/sense_note"/></td>
        </tr>
     </xsl:template>
     </xsl:template>


65번째 줄: 64번째 줄:


     <xsl:template match="heading">
     <xsl:template match="heading">
         <span style="color: darkcyan; font-size: 1.25em; vertical-align: baseline; margin: 0 2px;">
         <span style="color: darkcyan; font-size: 1.25em; font-weight: normal;">
             <br/>○ <xsl:apply-templates/><br/>
             ○ <xsl:apply-templates/><br/>
         </span>
         </span>
     </xsl:template>
     </xsl:template>


     <xsl:template match="annotation">
     <xsl:template match="annotation">
         <span style="color: olive; font-size: 0.75em; vertical-align: baseline; margin: 0 2px;">
         <span style="color: olive; font-size: 0.75em; font-weight: normal;">
             【<xsl:apply-templates/>】
             【<xsl:apply-templates/>】
         </span>
         </span>
     </xsl:template>
     </xsl:template>


     <xsl:template match="note|이두">
     <xsl:template match="이두">
         <span style="color: orange; font-size: 0.75em; vertical-align: baseline; margin: 0 2px;">
         <span style="color: orange; font-size: 0.75em; font-weight: bold;">
             <xsl:apply-templates/>
             <xsl:apply-templates/>
         </span>
         </span>
     </xsl:template>
     </xsl:template>

2026년 4월 27일 (월) 02:16 기준 최신판

<?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" encoding="UTF-8" indent="yes"/>
   <xsl:template match="/text_unit">

ID: <xsl:value-of select="@id"/>

           <xsl:apply-templates select="hanmun_text"/>
           <xsl:apply-templates select="glossary"/>
           <xsl:apply-templates select="translation"/>
   </xsl:template>
   <xsl:template match="hanmun_text | translation">
           
               [<xsl:value-of select="name()"/>]
           
               <xsl:apply-templates/>
   </xsl:template>
   <xsl:template match="glossary">
           [glossary]
<thead> </thead> <tbody> <xsl:for-each select="term"> </xsl:for-each> </tbody>
type hanmun korean scope definition sense_note
<xsl:value-of select="@type"/> <xsl:value-of select="lemma/hanmun"/> <xsl:value-of select="lemma/korean"/> <xsl:value-of select="sense/@scope"/> <xsl:value-of select="sense/definition"/> <xsl:value-of select="sense/sense_note"/>
           
   </xsl:template>
   <xsl:template match="title">
       
           § <xsl:apply-templates/>
</xsl:template>
   <xsl:template match="heading">
       
           ○ <xsl:apply-templates/>
</xsl:template>
   <xsl:template match="annotation">
       
           【<xsl:apply-templates/>】
       
   </xsl:template>
   <xsl:template match="이두">
       
           <xsl:apply-templates/>
       
   </xsl:template>
   <xsl:template match="*">
       <xsl:apply-templates/>
   </xsl:template>

</xsl:stylesheet>