system
March 11, 2009, 9:58am
1
Hi, Been looking at this xsl for a while but it’s not pulling in what it should be
<xsl:value-of select="document(//linkurl[@slotname='Image 89x96']/Value/@current)//@img_89_96_ext" />
I need to return the file type/extension that is held within img_89_96_ext but it’s not calling it in. Any ideas would be appreciated.
jimbo
March 13, 2009, 5:26am
2
Hi Nicki
document(//linkurl[@slotname='Image 89x96']/Value/@current)
It’s because this query returns the HTML file and not the XML behind.
So when you’re doing:
//@img_89_96_ext
You trying to find an attribute that’s not there. You need to replace the .html with XML before doing trying to find the img_89_96_ext attribute.
Cheers
James
system
March 18, 2009, 5:22am
3
Cheers for that Jimbo
Seemed to be working fine, previewing as expected, etc. But run a full publish last night and this morning it appears that there is a problem with the xml which caused the publish to fail. Running an incremental at the moment to gauge more info but not sure if you can think why this publishing error occurred.
<xsl:variable name="ImageDetail89x96">
<xsl:value-of select="//linkurl[@slotname='Image 89x96']/@contentid" />
</xsl:variable>
<xsl:variable name="ImageType89x96" select="/*/sys_AssemblerInfo/RelatedContent/linkurl[@slotname='Image 89x96']/Value/@current" />
<xsl:variable name="XMLDoc89x96">
<xsl:call-template name="replace">
<xsl:with-param name="string" select="$ImageType89x96" />
<xsl:with-param name="pattern">.html</xsl:with-param>
<xsl:with-param name="replacement">.xml</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="XMLDoc_ext89x96" select="document($XMLDoc89x96)//img_89_96_ext" />
<xsl:value-of select="concat('image_89_96_sa_',$ImageDetail89x96,$XMLDoc_ext89x96)" />