2015-01-29 3 views
1

많은 XSD 스키마가 있으므로 설명서를 너무 많이 읽고 사용하기가 어렵습니다. xs:annotation 요소가있는 동등한 XSD 파일을 생성하는 프로그램을 작성하는 방법은 무엇입니까? 어떤 xs:appinfo, xs:documentation 또는 포함 된 다른 요소 포함)이 발견 될 때마다 제거됩니까? 당신은 XSLT를 통해 각 파일을 실행할 수스키마에서 xs : annotation 요소를 제거하십시오.

답변

3

는 원치 않는 요소를 빼내야합니다 : @IanRoberts에서 언급 한 바와 같이 당신은 정말 요소의 xs:annotation 요소와 다른 두 가지 유형을 제거해야

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
    <xsl:output method="xml" indent="yes"/> 

    <xsl:template match="@* | node()"> 
    <xsl:copy> 
     <xsl:apply-templates select="@* | node()"/> 
    </xsl:copy> 
    </xsl:template> 

    <xsl:template match="xs:annotation" /> 
</xsl:stylesheet> 

을 것이다 그들과 함께 제거해야한다.

+3

실제로''는 appinfo만큼 충분할 것이고 문서는 주석 내부에서만 발생합니다. –

+0

@IanRoberts 실로! – JLRishe

관련 문제