원하지 않는 특정 요소를 제외하고 모든 XML을 복사하는 간단한 XSLT는 어떻게됩니까?
수정 된 identity transform을 사용하고 표시하지 않으려는 요소에 빈 템플릿을 추가하기 만하면됩니다.
예를 들어
:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<!--Identity transform copies all nodes and attributes by default -->
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
<!--Create an empty template for the elements that you want to suppress-->
<xsl:template match="ElementToRemove" />
</xsl:stylesheet>
사실 VTD-XML은 내장 된 분석의 오버 헤드를 우회 색인 기능, 구문 분석하지 않고 XML 파일을 사용하여 작업 할 수있는 방법이 ... 한 사전 구문 분석 제공 XML과 함께 색인을 문서화하고 유지합니다. 그것은 vtd + xml이라고합니다 ... http://www.codeproject.com/Articles/24663/Index-XML-Documents-with-VTD-XML –