Text unit sample.xsl: 두 판 사이의 차이
편집 요약 없음 |
편집 요약 없음 |
||
| 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" | <xsl:output method="html" encoding="UTF-8" indent="yes"/> | ||
<xsl:template match="/"> | <xsl:template match="/text_unit"> | ||
< | <div class="text-unit-container" style="font-family: 'Noto Serif KR', serif; line-height: 1.8; padding: 20px;"> | ||
<h2 style="border-bottom: 2px solid #333; padding-bottom: 5px;"> | |||
ID: <xsl:value-of select="@id"/> | |||
</h2> | |||
<xsl:apply-templates select="hanmun_text"/> | |||
<xsl:apply-templates select="glossary"/> | |||
<xsl:apply-templates select="translation"/> | |||
</div> | |||
</ | |||
</ | |||
< | |||
</ | |||
</ | |||
</xsl:template> | </xsl:template> | ||
<xsl:template match="hanmun_text | translation"> | <xsl:template match="hanmun_text | translation"> | ||
<xsl:apply-templates/> | <div style="margin-top: 20px; padding: 15px; background-color: #f9f9f9; border-left: 5px solid #ccc;"> | ||
<strong style="display:block; margin-bottom: 10px; color: #555;"> | |||
[<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 style="margin-top: 30px;"> | ||
<thead> | <strong style="display:block; margin-bottom: 10px; color: #555;">[Glossary]</strong> | ||
<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> | ||
< | <td style="padding: 8px; border: 1px solid #ddd; text-align:center;"><xsl:value-of select="@type"/></td> | ||
< | <td style="padding: 8px; border: 1px solid #ddd; font-weight:bold;"><xsl:value-of select="lemma/hanmun"/></td> | ||
< | <td style="padding: 8px; border: 1px solid #ddd;"><xsl:value-of select="lemma/korean"/></td> | ||
< | <td style="padding: 8px; border: 1px solid #ddd; text-align:center;"><xsl:value-of select="sense/@scope"/></td> | ||
< | <td style="padding: 8px; border: 1px solid #ddd;"><xsl:value-of select="sense/definition"/></td> | ||
< | <td style="padding: 8px; border: 1px solid #ddd; color: #666; font-style: italic;"><xsl:value-of select="sense/sense_note"/></td> | ||
</tr> | </tr> | ||
</ | </xsl:for-each> | ||
</tbody> | |||
</table> | |||
</div> | |||
</ | |||
</xsl:template> | </xsl:template> | ||
| 67번째 줄: | 69번째 줄: | ||
<xsl:template match="annotation"> | <xsl:template match="annotation"> | ||
<span style="color: olive; font-size: | <span style="color: olive; font-size: 1.25em; font-weight: normal;"> | ||
【<xsl:apply-templates/>】 | 【<xsl:apply-templates/>】 | ||
</span> | </span> | ||
</xsl:template> | </xsl:template> | ||
<xsl:template match=" | <xsl:template match="이두"> | ||
<span style="color: orange; font-size: | <span style="color: orange; font-size: 1.25em; font-weight: bold;"> | ||
<xsl:apply-templates/> | |||
</span> | </span> | ||
</xsl:template> | </xsl:template> | ||
2026년 4월 27일 (월) 01:58 판
<?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>