Developer forum

Forum » Templates » Ecom related products

Ecom related products


Reply
I have a xslt template that loops through the related products on a product detail page, and outputs it as xml.

I've made a simple version of my template here to highlight the problem

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
 <xsl:output method="html" omit-xml-declaration="yes" indent="yes"  encoding="utf-8" />
 <xsl:param name="html-content-type" />
 <xsl:variable name="availableloops" select="'ProductRelatedGroups,RelatedProducts'" />
 <xsl:template match="/Template">
        <xsl:for-each select="loop[@name='ProductRelatedGroups']/item">
            <xsl:for-each select="./loop[@name='RelatedProducts']/item">
               <Link Name="MyLink" Href="http://dynamicweb.dk"></Link>
            </xsl:for-each>
        </xsl:for-each>
   </xsl:template>

</xsl:stylesheet>

this will result in unclosed Link tag like this:
<Link Name="MyLink"Href="
http://dynamicweb.dk">

But if I change the tag name from Link to fx. String, it outputs the close tag nicely:
<String Name="MyLink"Href="
http://dynamicweb.dk"></String>

And to make it even wireder, i have an Ecom productlist where I do the same inside the product loop, and here it works nicely.

Does anyone have any idea of whats is wrong?


Replies

 
Nicolai Høeg Pedersen
Reply
If output method i set to html it does not close all tags - if set to xml, tags are allways closed... Could that be it?
 
Reply
that solved the problem. thanks

 

You must be logged in to post in the forum