cancel
Showing results for 
Search instead for 
Did you mean: 

XSL substring

Former Member
0 Kudos

Hi All,

can anyone let me know how can I use substring with <xsl:value-of select= " " > I want to use something like

<xsl:value-of select="$unsortedNodes/E1MARAM/E1MVKEM/substring(VKORG,0,2">

where VKORG is the field name for Target market. However, this is not the correct format. How can I use in other ways?

Below is my code using for-each and I want to use value-of select instead with substring function.

<Table Name="Countries - ISO 3166" ReferencePath="GTINs~Target Market">

<xsl:for-each select="$unsortedNodes/E1MARAM/E1MVKEM"> <Record ID="" ReferenceID="">

<Field Name="Country Code" Type="Field">

<xsl:variable name= "storeVkorg" select="substring(VKORG,0,2)" />

<ComplexValue Key= "{$storeVkorg}">

</ComplexValue>

</Field>

</Record>

</Table>

Regards,

Hemal

Accepted Solutions (0)

Answers (1)

Answers (1)

henrique_pinto
Active Contributor
0 Kudos

Put the whole XPath in the substring function.

It'll be like:

<xsl:value-of select="substring($unsortedNodes/E1MARAM/E1MVKEM/VKORG,0,2)">

But if you are still using the for-each function, you wont need the whole path, just use the same select as variable does.

Regards,

Henrique.

PS: I'll check on your email. I swear. 🐵