<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*" />
</xsl:copy>
</xsl:template>
<xsl:template match="*[@th:remove='all']" /><!-- th:remove=all 要素は削除 -->
<xsl:template match="*[@th:remove='all-but-first']">
<!-- th:remove=all-but-first 要素は最初を残して削除 -->
<xsl:copy>
<xsl:for-each select="@*">
<xsl:copy/>
</xsl:for-each>
<xsl:apply-templates select="*[1]" />
</xsl:copy>
</xsl:template>
<xsl:template match="*[@th:include] | *[@th:replace] | *[@th:text]">
<!-- 中身が要らない要素はざくっと捨てる -->
<xsl:copy>
<xsl:for-each select="@*">
<xsl:copy/>
</xsl:for-each>
<xsl:value-of select="translate(@th:*, '@$#{}', '')" />
</xsl:copy>
</xsl:template>
<xsl:template match="comment()"><!-- コメントは Thymeleaf コメントに変換 -->
<xsl:comment>/*<xsl:value-of select="." />*/</xsl:comment>
</xsl:template>
</xsl:stylesheet>
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
01