【问题标题】:Trying to get the element in xslt 1.0.But unable to get in response xml试图在 xslt 1.0 中获取元素。但无法响应 xml
【发布时间】:2017-08-23 22:39:54
【问题描述】:

Reqeust xml is attached

<xsl:if test="../tn:notification/evt0:relationship/evt0:businessInteractionIdentifier/evt0:customerOrderIdentifier/evt0:id/evt0:idContext/evt0:value">
        <tns:projectIdentifier>

                        <tns:idContext>
                                                            <tns:value>
                                    <xsl:value-of
                                        select="../tn:notification/evt0:relationship/evt0:businessInteractionIdentifier/evt0:customerOrderIdentifier/evt0:id/evt0:idContext/evt0:value" />
                                </tns:value>
                                </tns:idContext>
                                                    [Response xsd attached][2]

                </tns:projectIdentifier>

这是编写但无法运行的 xsl 代码

【问题讨论】:

  • 请发布您的 XML,而不是图片。还请发布一个有效的 XSLT。

标签: xml xslt-1.0 xalan


【解决方案1】:

检查此代码我认为您的问题解决了

<xsl:if test="../tn:notification/evt0:relationship/evt0:businessInteractionIdentifier/evt0:customerOrderIdentifier/evt0:idContext/evt0:value">
<tns:projectIdentifier>
<tns:idContext>
<tns:value>
<xsl:value-of select="//evt0:value" />
</tns:value>
</tns:idContext>
</tns:projectIdentifier>

【讨论】:

  • 你想输出什么
【解决方案2】:

我是这样解决的:

<xsl:if test="../../tn:notification/evt0:relationship/evt0:businessInteractionIdentifier/evt0:customerOrderIdentifier/evt0:idContext/evt0:value">

我保持其他一切不变。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2017-02-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多