내가 가진 내가 templete입니다억제/속성 값을 기반으로 XML의 내용을 삭제
<xsl:template match="para[@type='new']">
</xsl:template>
을 사용하여 다음을 수행 할 수있는 = '새로운'몸/파라/@ 유형을 억제 할
<xml>
<Text>
<body>
<para type="new"> This para needs to be suppress </para>
<para type="old"> This is an old para </para>
</body>
</Text>
</xml>
같은 XML
그런데 실제로 body가 다른 요소를 포함하지 않으면 para/@ type = 'new'라는 조건을 추가하여 전체 본문 요소를 제거해야한다고 말합니다.
그래서
<xml>
<Text>
<body>
<para type="new"> This para needs to be suppress </para>
</body>
</Text>
</xml>
는
<xml>
<Text>
</Text>
</xml>
및
이<xml>
<Text>
<body>
<para type="new"> This para needs to be suppress </para>
<para type="old"> This is an old para </para>
</body>
</Text>
</xml>
가 반환해야합니다 반환해야
<xml>
<Text>
<body>
<para type="old"> This is an old para </para>
</body>
</Text>
</xml>
어떤 도움을하거나 작업을 수행하는 방법을 암시 ...
body 요소에 대한 템플릿이 있으면 표시해 주시겠습니까? 너무 길지 않다면 전체 XSLT를 사용하십시오. – JLRishe
또한 ** body 요소가 ** child 요소가 전혀없는 경우 어떻게됩니까? –
본문에는 항상 0 또는 1 개의 "새로운"paras와 0 또는 1 개의 "old"paras가 있으며 그 밖의 것은 없습니까? – JLRishe