我有一个这样的 XML:
<PurchaseOrder>
<ID>1</ID>
<PurchaseOrderLine>
<DATA>100<DATA>
</PurchaseOrderLine>
<PurchaseOrderLine>
<DATA>200<DATA>
</PurchaseOrderLine>
<PurchaseOrderLine>
<DATA>300<DATA>
</PurchaseOrderLine>
</PurchaseOrder>
<PurchaseOrder>
<ID>2</ID>
<PurchaseOrderLine>
<DATA>100<DATA>
</PurchaseOrderLine>
<PurchaseOrderLine>
<DATA>200<DATA>
</PurchaseOrderLine>
<PurchaseOrderLine>
<DATA>300<DATA>
</PurchaseOrderLine>
</PurchaseOrder>
<PurchaseOrder>
<ID>3</ID>
<PurchaseOrderLine>
<DATA>100<DATA>
</PurchaseOrderLine>
<PurchaseOrderLine>
<DATA>200<DATA>
</PurchaseOrderLine>
<PurchaseOrderLine>
<DATA>300<DATA>
</PurchaseOrderLine>
</PurchaseOrder>
和 XSL:
<xsl:template match="PurchaseOrder">
<xsl:apply-templates select="PurchaseOrderLine"/>
</xsl:template>
<xsl:template match="PurchaseOrderLine">
<!-- I want to get the PurchaseOrder\ID here for the current PurchaseOrder -->
</xsl:template>
如何在 PurchaseOrderLine 中获取当前父元素值 (PurchaseOrder\ID)?