<xsl:apply-templates>
과 관련하여 질문이 있습니다. XSLT : <apply-templates select = "...">
<transcription>
<subst>
<del>wrong</del>
<add>right</add>
</subst>
</transcription>
가 지금은 XSLT를 사용하여 다른 방법으로 전사의 녹음을 처리 할 :
은 (http://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-subst.html 참조) 나는이 같은 XML이 있다고 가정 할 수 있습니다.
난 그냥 사용자에게 보정을 제시 할 경우, 나는이 같은 XSLT 템플릿을 사용할 수 있습니다 그러나
<xsl:template match="subst"><xsl:apply-templates select="./add"/></xsl:template>
<xsl:template match="subst/add"><xsl:apply-templates/></xsl:template>
을, 나는 또한 다음과 같이 작성할 수있다 :
<xsl:template match="subst"><xsl:apply-templates/></xsl:template>
<xsl:template match="subst/add"><xsl:apply-templates/></xsl:template>
<!-- del: ignore contents -->
<xsl:template match="subst/del"></xsl:template>
을 첫 번째 경우 , 나는 명시 적으로 주소 add
을 <subst>
안에두고, <del>
을 무시합니다.
두 번째 경우에는 요소를 사용하지 않는 템플릿을 제공하여 동일한 효과가 발생하므로 <del>
을 무시합니다.
내가 잘못 본 것이 아니라면 두 가지 방법이 동일합니다. 어느 것이 더 낫습니까?
입력에'subst'가 없으므로''는 아무 것도하지 않습니다. –
당신은 템플릿을 가지고 있지 않아서 "델을 무시하지"않습니다. 그런 다음 기본 템플릿을 누르십시오. –
죄송합니다. subst 요소를 추가하는 것을 잊었습니다. Thx, Stefan, 당신의 의견이 도움이되었습니다! – user130685