on 09-01-2006 3:28 PM
Hi All,
Can anyone let me know how can I write xsl:for-each for below select query.
<xsl:if test="$loopControl= 2">
<xsl:value-of select="substring(E1MVKEM/VKORG,0,2)" />
</xsl:if>
<xsl:if test="$loopControl= 1">
<xsl:value-of select="substring(E1MVKEM/VKORG,0,2)" />
</xsl:if>
When I write as below I get an error.
<xsl:for-each select="substring(E1MVKEM/VKORG,0,2)" />
Thanks in advance,
Hemal
Hi,
I want that to loop below mulitple times of MVKEM. There are multiple MVKEM with differnt VKORG in each, for example (FR and US) If I loop like
<xsl:for-each select="E1MVKEM">
<xsl:value-of select="substring(E1MVKEM/VKORG,0,2)" />
</xsl:for-each>
then it gives out put as
<ComplexValue Key="FRFR">
whereas the output should be
<ComplexValue Key="FR">
and the next time
<ComplexValue Key="US">
Regards,
Hemal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
<i><xsl:for-each select="E1MVKEM">
<xsl:value-of select="substring(E1MVKEM/VKORG,0,2)" />
</xsl:for-each></i>
>>>Here try to give absolute path in for-each statementand test it i.e from root level
Have a look into this also-
http://www.w3schools.com/xsl/xsl_for_each.asp
Hope this helps,
Regards,
Moorthy
If you want to get the first two characters of the string, use substring(xxx, 1, 2).
In XSLT, unlike Java, the 1st position of an array has index = 1.
Regards,
Henrique.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.