사용하여 다음과 같은 XPath 식 : 여기에 접두사 h:
/*/h:body//h:h1
|
/*/h:body//h:h1/following::node()
[count(. | //h:table[@id='toc']
/preceding::node()
)
=
count(//h:table[@id='toc']
/preceding::node()
)
]
는 XHTML 네임 스페이스()에 바인딩됩니다.
이 변환은 원하는 결과가 정말 생산되는 것을 보여줍니다 위키 피 디아 기사의 XHTML 문서에 실행하면
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:h="http://www.w3.org/1999/xhtml"
>
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<xsl:copy-of select=
"/*/h:body//h:h1
|
/*/h:body//h:h1/following::node()
[count(. | //h:table[@id='toc']
/preceding::node()
)
=
count(//h:table[@id='toc']
/preceding::node()
)
]
"/>
</xsl:template>
</xsl:stylesheet>
가 (당신이이 문서에 대한 두 개의 엔티티
및 ®
를 정의해야), 원하는 결과가 생성됩니다.
위키 미디어 API를 살펴볼 수 있습니다. –