Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
i have some XSLT code to create a list of DIV's for a carousel. Unfortunately the html generated from the code below closes the div in the wrong place for what I need:
<xsl:element name="div"> <xsl:attribute name="style"> <xsl:value-of select="umbraco.library:GetMedia(./@id,'false')/data [@alias = 'umbracoFile']"/> </xsl:attribute></xsl:element>
produces.......
<div style="/media/1850/billboard_placeholder.jpg" /><div style="/media/1896/billboard_placeholder.jpg" />
I really need it to create the closing </div> like so:
<div style="/media/1850/billboard_placeholder.jpg"></div><div style="/media/1896/billboard_placeholder.jpg"></div>
as the carousel don't work no more. Any help would be appreciated.
Regards,Kevin
Hey Kevin,
Try forcing a space within the div
<xsl:element name="div"> <xsl:attribute name="style"> <xsl:value-of select="umbraco.library:GetMedia(./@id,'false')/data [@alias = 'umbracoFile']"/> </xsl:attribute> <xsl:text> </xsl:text></xsl:element>
Matt
Hi Kevin,
You either need to change the output mode of the XSLT to "html":
<xsl:output method="html" />
or, include some kind of spacer inside the <div>, like so:
<xsl:element name="div"> <xsl:attribute name="style"> <xsl:value-of select="umbraco.library:GetMedia(./@id,'false')/data [@alias = 'umbracoFile']"/> </xsl:attribute> <xsl:comment><xsl:text>.</xsl:text></xsl:comment> </xsl:element>
Cheers, Lee.
Damn, replied the same time as Matt. LOL!
;)
ok, sorted it by having a cup of tea and rewriting it :-) Thanks for all the help though.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
XSLT not creating correct </div>
i have some XSLT code to create a list of DIV's for a carousel. Unfortunately the html generated from the code below closes the div in the wrong place for what I need:
<xsl:element name="div">
<xsl:attribute name="style">
<xsl:value-of select="umbraco.library:GetMedia(./@id,'false')/data [@alias = 'umbracoFile']"/>
</xsl:attribute>
</xsl:element>
produces.......
I really need it to create the closing </div> like so:
as the carousel don't work no more. Any help would be appreciated.
Regards,
Kevin
Hey Kevin,
Try forcing a space within the div
Matt
Hi Kevin,
You either need to change the output mode of the XSLT to "html":
or, include some kind of spacer inside the <div>, like so:
Cheers, Lee.
Damn, replied the same time as Matt. LOL!
;)
ok, sorted it by having a cup of tea and rewriting it :-) Thanks for all the help though.
is working on a reply...