Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
one of my XSLT page contains this code, can any one help me to understand what exactly it will return.


XML
<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
Posted
Updated 9-Mar-15 2:48am
v2

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!
 
Share this answer
 
Comments
ajitdstar4u 9-Mar-15 9:26am    
Thanks Buddy for your time and response, i tried the online:
http://xslttest.appspot.com/[^] and able to resolve my problem.
E.F. Nijboer 9-Mar-15 13:19pm    
Great I could help you out!
ajitdstar4u 2-Apr-15 7:21am    
so if i change the code of XSLT file in server ? will this work for me ?
E.F. Nijboer 2-Apr-15 10:48am    
Need a little more context i'm afraid. Please explain.
it will always give the Vendor as number due to
XML
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>
 
Share this answer
 
Comments
ajitdstar4u 2-Apr-15 7:13am    
so can i change the code of XSLT file in server ?
after that will it get reflect ??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900