XSLでXSLファイルを解析しています。私はそれにノードを動的に見つける問題があります。XSL:ノードを動的に選択
<linkbase xmlns="http://www.xbrl.org/2003/linkbase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xbrl.org/2003/linkbase http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd">
<labelLink xmlns:xlink="http://www.w3.org/1999/xlink" xlink:role="http://www.xbrl.org/2003/role/link" xlink:type="extended">
<loc xlink:type="locator" xlink:href="de-gaap-ci-2010-12-16.xsd#de-gaap-ci_bs.ass.fixAss.fin.otherLoans.other" xlink:label="de-gaap-ci_bs.ass.fixAss.fin.otherLoans.other"/>
<!-- many <loc... elements -->
<labelArc xlink:from="de-gaap-ci_bs.ass.fixAss.fin.otherLoans.other" xlink:to="label_de-gaap-ci_bs.ass.fixAss.fin.otherLoans.other" priority="1" xlink:arcrole="http://www.xbrl.org/2003/arcrole/concept-label" xlink:type="arc"/>
<!-- many <labelArc... elements -->
</labelLink>
</linkbase>
私はlabelArc
要素を解析し、loc
要素からの情報を含めるようにしたいのです:ここではシナリオです。これは、次のように私のXSLコードが見えます... SAP/ABAPで
が行われます。
<xsl:template match="lb:labelArc">
<xsl:variable name="arc_to" select="@xlink:to"/>
<TY_T_LABELARC>
<LOC> <xsl:value-of select="//lb:loc[@xlink:label='$arc_to']/@xlink:href"/> </LOC>
<FROM> <xsl:value-of select="@xlink:from"/> </FROM>
<TO> <xsl:value-of select="@xlink:to"/> </TO>
<!-- Other values follow -->
</TY_T_LABELARC>
</xsl:template>
私は出力にloc
タグから@href
を含めたいです。対応するloc
タグの値は@to
で、それぞれlabelArc
タグです。
私の問題は、この文は、空の値を返すということです。
<xsl:value-of select="//lb:loc[@label='$arc_to']/@href"/>
私がリードする名前空間の両方を試してみました「のxlink:」各属性にし、それなしで...
任意のアイデア?
不足している「label_」の間違いを指摘してくれてありがとう!あなたは私が以前認識していなかった私の別の問題を暗黙に解決しました:-) –
@MarcoNätlitz:あなたは大歓迎です。 –