Episode.xsl: 두 판 사이의 차이
새 문서: <?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="/episode"/> </div> <xsl:template match="episode"> <div class="content-unit"> <xsl:apply-templates/> </div>... |
편집 요약 없음 |
||
| (같은 사용자의 중간 판 4개는 보이지 않습니다) | |||
| 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" encoding="UTF-8" indent="yes"/> | <xsl:output method="html" encoding="UTF-8" indent="yes"/> | ||
<xsl:template match="/"> | <xsl:template match="/episode"> | ||
< | <!-- lang 속성이 Arabic인 경우 rtl(우->좌), 아닐 경우 ltr(좌->우) 설정 --> | ||
<xsl:variable name="direction"> | |||
<xsl:choose> | |||
<xsl:when test="@lang = 'Arabic'">rtl</xsl:when> | |||
<xsl:otherwise>ltr</xsl:otherwise> | |||
</xsl:choose> | |||
</xsl:variable> | |||
<!-- HTML lang 속성 매핑 (Arabic -> ar, 기타 -> ko/en 등) --> | |||
<xsl:variable name="htmlLang"> | |||
<xsl:choose> | |||
<xsl:when test="@lang = 'Arabic'">ar</xsl:when> | |||
<xsl:otherwise>ko</xsl:otherwise> | |||
</xsl:choose> | |||
</xsl:variable> | |||
<html lang="{$htmlLang}" dir="{$direction}"> | |||
<xsl: | <head> | ||
<meta charset="UTF-8"/> | |||
<title><xsl:value-of select="title"/></title> | |||
<style> | |||
body { | |||
font-family: -apple-system, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; | |||
background-color: #f8fafc; | |||
color: #1e293b; | |||
padding: 40px 20px; | |||
display: flex; | |||
justify-content: center; | |||
} | |||
.card { | |||
background: #ffffff; | |||
max-width: 720px; | |||
width: 100%; | |||
border-radius: 12px; | |||
border: 1px solid #e2e8f0; | |||
padding: 30px; | |||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); | |||
} | |||
h1 { | |||
font-size: 1.6rem; | |||
color: #0f172a; | |||
border-bottom: 2px solid #f1f5f9; | |||
padding-bottom: 12px; | |||
margin-top: 0; | |||
} | |||
p.narrative { | |||
font-size: 1.05rem; | |||
line-height: 1.9; | |||
color: #334155; | |||
white-space: pre-line; /* 본문 줄바꿈 유지 */ | |||
} | |||
/* Arabic일 경우 추가 가독성 스타일 */ | |||
[dir="rtl"] { | |||
text-align: right; | |||
} | |||
</style> | |||
</head> | |||
<body> | |||
<div class="card"> | |||
<h1><xsl:value-of select="title"/></h1> | |||
<p class="narrative"><xsl:value-of select="narrative"/></p> | |||
</div> | |||
</body> | |||
</html> | |||
</xsl:template> | </xsl:template> | ||
</xsl:stylesheet> | </xsl:stylesheet> | ||
2026년 8월 21일 (금) 01:15 기준 최신판
<?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="/episode">
<xsl:variable name="direction">
<xsl:choose>
<xsl:when test="@lang = 'Arabic'">rtl</xsl:when>
<xsl:otherwise>ltr</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="htmlLang">
<xsl:choose>
<xsl:when test="@lang = 'Arabic'">ar</xsl:when>
<xsl:otherwise>ko</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="title"/>
</xsl:template>
</xsl:stylesheet>