필자는 빈 태그 (필수 필드 제외)를 출력에서 제외해야합니다. 필수 필드는 비어있는 경우에도 출력에 있어야합니다.XSLT : 출력에서 몇 개의 빈 태그 만 제외하는 방법은 무엇입니까?
다음 xslt를 사용하여 빈 태그를 제외 할 수 있습니다. 그러나 필수 필드조차도 비어있는 경우 출력에서 제거됩니다. 제발 조언.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes" method="xml"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match= "*[not(@*|*|comment()|processing-instruction()) and
normalizespace()='']"/>
</xsl:stylesheet>