任何人都可以帮助我理解这个XSL的东西 [英] can any one help me to understand this XSL stuff

查看:121
本文介绍了任何人都可以帮助我理解这个XSL的东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个XSLT页面包含这个代码,任何人都可以帮助我理解它将返回什么。





< pre lang =xml> < xsl:if test = string-length(DMS_Document / Payload / DMS_DispatchResponse /消息/供应商)!= 0 >
< xsl:element name < span class =code-keyword> = VENDOR_ID >
< xsl:value-of 选择 = number(DMS_Document / Payload / DMS_DispatchResponse / Message / Vendor) / >
< / xsl:element >





疑问1:此代码是否始终将供应商作为数字返回。 
2:或者它将返回DMS_Document / Payload / DMS_DispatchResponse / Message / Vendor中的内容







提前感谢

解决方案

为什么不测试它和检查结果?看一下你可以在codeproject上找到的工具:

(非常)简单的XSLT测试实用程序 [ ^ ]



或在线试用:

http://xslttest.appspot.com/ [ ^ ]



祝你好运!


它总是将供应商作为号码给予

 number(DMS_Document / Payload / DMS_DispatchResponse / Message / Vendor)


& lt; pre lang =& quot; xml& quot;& gt ;& amp; lt; xsl:if test =& amp; quot; string-length(DMS_Document / Payload / DMS_DispatchResponse / Message / Vendor)!= 0& amp; quot;& amp; gt;
& amp; lt; xsl:element name =& amp; quot; VENDOR_ID& amp; quot;& amp; gt;
& amp; lt; xsl:value-of select =& amp; quot; number(DMS_Document / Payload / DMS_DispatchResponse / Message / Vendor)& amp; quot; /& amp; gt;
& amp; lt; / xsl:element& amp; gt;& lt; / pre& gt; < / pre >


one of my XSLT page contains this code, can any one help me to understand what exactly it will return.


<xsl:if test="string-length(DMS_Document/Payload/DMS_DispatchResponse/Message/Vendor) != 0">
                            <xsl:element name="VENDOR_ID">
                                <xsl:value-of select="number(DMS_Document/Payload/DMS_DispatchResponse/Message/Vendor)"/>
                            </xsl:element>



Doubt 1: will this code always return Vendor as number.
2:  or it will return what is there in DMS_Document/Payload/DMS_DispatchResponse/Message/Vendor




thanks in advance

解决方案

Why not test it amd check the results? Have a look at a tool you can find here on codeproject:
A (very) simple XSLT test utility[^]

Or try it online:
http://xslttest.appspot.com/[^]

Good luck!


it will always give the Vendor as number due to

number(DMS_Document/Payload/DMS_DispatchResponse/Message/Vendor)


&lt;pre lang=&quot;xml&quot;&gt;&amp;lt;xsl:if test=&amp;quot;string-length(DMS_Document/Payload/DMS_DispatchResponse/Message/Vendor) != 0&amp;quot;&amp;gt;
                            &amp;lt;xsl:element name=&amp;quot;VENDOR_ID&amp;quot;&amp;gt;
                                &amp;lt;xsl:value-of select=&amp;quot;number(DMS_Document/Payload/DMS_DispatchResponse/Message/Vendor)&amp;quot;/&amp;gt;
                            &amp;lt;/xsl:element&amp;gt;&lt;/pre&gt;</pre>


这篇关于任何人都可以帮助我理解这个XSL的东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆