Text.xsl

Vaquita Wiki
Tutor (토론 | 기여)님의 2026년 8월 26일 (수) 16:12 판 (새 문서: <?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="/"> <div class="text-container" style="line-height: 1.8; font-size: 1.1em;"> <xsl:apply-templates select="//hanmun_text | //japanese_text | //translation"/> </div> <!-- ▼ 교주(校註) 각주: 문서에 correction 이 있을 때만 출...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

<?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="/">
           <xsl:apply-templates select="//hanmun_text | //japanese_text | //translation"/>
       <xsl:if test="//correction">

               <xsl:for-each select="//correction">
                   <xsl:text>* 교주 </xsl:text>
                   <xsl:value-of select="format-number(position(), '00')"/>
                   <xsl:text>: </xsl:text>
                   <xsl:for-each select="@*">
                       <xsl:value-of select="name()"/>
                       <xsl:text>="</xsl:text>
                       <xsl:value-of select="."/>
                       <xsl:text>"</xsl:text>
                       <xsl:if test="position() != last()">
                           <xsl:text> </xsl:text>
                       </xsl:if>
                   </xsl:for-each>
                   
</xsl:for-each>
       </xsl:if>
   </xsl:template>
   <xsl:template match="hanmun_text | japanese_text | translation">
           <xsl:apply-templates/>
   </xsl:template>
   <xsl:template match="title">
       
           § <xsl:apply-templates/>
</xsl:template>
   <xsl:template match="heading">
       
           
○ <xsl:apply-templates/>
</xsl:template>
   <xsl:template match="commentary">
       
           <xsl:text>【</xsl:text>
           <xsl:choose>
               <xsl:when test="@commentator">
                   <xsl:value-of select="@commentator"/>
                   <xsl:text>: </xsl:text>
               </xsl:when>
           </xsl:choose>
           <xsl:apply-templates/>
           <xsl:text>】</xsl:text>
       
   </xsl:template>
   <xsl:template match="annotation">
       
           <xsl:text>【</xsl:text>
           <xsl:choose>
               <xsl:when test="@annotator">
                   <xsl:value-of select="@annotator"/>
                   <xsl:text>: </xsl:text>
               </xsl:when>
           </xsl:choose>
           <xsl:apply-templates/>
           <xsl:text>】</xsl:text>
       
   </xsl:template>
   <xsl:template match="note|이두">
       
           〔<xsl:apply-templates/>]
       
   </xsl:template>
   <xsl:template match="correction">
       
           <xsl:apply-templates/>
       
       
           <xsl:text>【교주 </xsl:text>
           <xsl:value-of select="format-number(count(preceding::correction) + 1, '00')"/>
           <xsl:text>】</xsl:text>
       
   </xsl:template>
   <xsl:template match="*">
       <xsl:apply-templates/>
   </xsl:template>

</xsl:stylesheet>