Quantcast
Channel: Active questions tagged feed - Stack Overflow
Viewing all articles
Browse latest Browse all 542

How to change get third position of string on XML (Using substring)

$
0
0

I'm trying to generate a product feed with Xtento Product export on magento and I can't get the product_type to show the value of the third position.

Can you give me a hand with this?

The code:

<!--product_type --><xsl:element name="product_type"><xsl:choose><xsl:when test="string(xtento_mapped_category)"><xsl:value-of select="xtento_mapped_category"/></xsl:when> <xsl:when test="string(cats/cat[children_count=0]/path_name)"><xsl:value-of select="substring-after(substring-after(cats/cat[children_count=0]/path_name,'>'),'> ')" /></xsl:when><xsl:otherwise><xsl:value-of select="substring-after(substring-after(parent_item/cats/cat[children_count=0]/path_name,'>'),'> ')" /></xsl:otherwise></xsl:choose></xsl:element>

Output product_type: Women > Undies > Thong Underwear > Cotton Thong Underwear

It should be just "Thong Underwear" or the 3rth position of the string.


Viewing all articles
Browse latest Browse all 542

Trending Articles