2
我在XML模式中有組定義。像這樣:在XSL轉換中使用XML模式組
<attributeGroup name="my_attributes">
<attribute ref="ns:foo" />
<attribute ref="ns:bar" />
</attributeGroup>
此外,我有一個XML轉換,我希望能夠重用這些定義。是否可以創建一個匹配這樣的組的模板?事情是這樣的,也許:
<xsl:template matchGroup="my_attributes">
<foobar>
<xsl:copy-of select="@*"/>
<xsl:value-of select="." />
</foobar>
</xsl:template>
「@ns:foo [../@ns:bar]」是什麼意思? – Alp
@Alp:我用你要求的解釋更新了答案。 –
謝謝你的解釋,但那不是我故意需要的。 XSD中的attributeGroup表示允許任何屬性,它們不必一次全部出現(忽略父項)。 – Alp