简体   繁体   English

确定价值 <xsl:value-of> 上下文项/节点

[英]Identify value of <xsl:value-of> context item/node

Newbie question on XML and XPath. 关于XML和XPath的新手问题。 I'm debugging some reports produced using an XML transformation, in addition to some associated java and sql functions. 除了一些关联的Java和sql函数之外,我还在调试使用XML转换生成的一些报告。 Can someone please help me identify how the following value is populated when the associated xslt is applied to the source XML. 有人可以帮我确定将关联的xslt应用于源XML时如何填充以下值。

I have the following statement in an xslt: 我在xslt中有以下语句:

<xsl:if test="$prodType = 'IRS' or $prodType = 'ZCS' or $prodType = 'BASIS'">
  <xsl:value-of select="$root/ISDA"/>
</xsl:if>

The $root variable is defined at the top of the xslt as: $ root变量在xslt的顶部定义为:

<xsl:variable name="root" select="/*"/>

So, I would expect that I could find an "ISDA" element in the source XML, but that is not the case. 因此,我希望可以在源XML中找到一个“ ISDA”元素,但事实并非如此。 I see that we're populating a related variable in our java code (which is what shows up in the report I'm sure), but I'm not able to make the connection between the "ISDA" item in the xslt and the "isda" variable in our java code. 我看到我们在Java代码中填充了一个相关变量(这是我确定在报告中显示的内容),但是我无法在xslt中的“ ISDA”项与我们的Java代码中的“ isda”变量。

Questions: 问题:

  1. Is there an Xpath function I'm missing? 我缺少Xpath函数吗?
  2. How can the xslt transformation pick up the "isda" value from java (or possibly SQL)? xslt转换如何从Java(或可能的SQL)中获取“ isda”值?
  3. Shouldn't the "ISDA" item/variable be defined somewhere? 不应在某处定义“ ISDA”项目/变量吗? I'm unable to locate it (I've searched properties files and associated unix start-up scripts, but not SQL code which I don't have access to). 我找不到它(我已经搜索了属性文件和关联的unix启动脚本,但没有搜索我无法访问的SQL代码)。

Any pointers would be appreciated. 任何指针将不胜感激。

The source XML would start with something like: 源XML将以类似以下内容的开头:

<SWAP>
 <TradeId>467262IC</TradeId>
 <TradeType>SWAP</TradeType>
 <Env TYPE="EntList" SINGLE="Y">
  <ENV>
  ...

Thanks much, 非常感谢,

Al D. Al D.

I was able to find the java method used to populate the variable above. 我能够找到用于填充上述变量的java方法。 There are several transformations executed in sequence by the java method, only one of which uses the xslt and XML source file I commented on above. java方法按顺序执行了几种转换,其中只有一种使用了我上面评论过的xslt和XML源文件。 There is an XML reference source (hiding in a different folder) used in another transformation that held the value I was interested in. 在另一个转换中使用了一个XML参考源(位于另一个文件夹中),该源保留了我感兴趣的值。

Thanks much, 非常感谢,

Al D. Al D.

Interestingly, there was no call to the other method I mentioned above that held the similar isda variable, which looks like a little bloat. 有趣的是,没有调用我上面提到的另一个方法,该方法持有类似的isda变量,看起来有点膨胀。 Made the search a little tougher :^) 使搜索更加困难:^)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM