Hi Sajid, you pointed out a real problem there. As I just wrote in another post:
"The problem with your suggestion is that replacing "$parent/node" with "$parent/*[@isDoc]" will cause problems if the <node> in question was a media-node. And as far as I can see right now, there is no easy way to determine this. One solution to work around this to give the user the option to run the converter in two different "modes", like "Documents" mode and "Media" mode. I'll give this some thought and update the package in the next couple of days..."
Now, the problem is that my converter already replaces every occurence of "::node" with "*[@isDoc]". And as I wrote above, that's bad if it was a media-node.
convert ver-4 xslt to ver4.5 using xsltconverter package
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:variable name="ID" select="$currentPage/frontPageImages"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<xsl:if test="$ID > 0">
<xsl:variable name="mediaItems" select="umbraco.library:GetMedia($ID, true())"/>
<xsl:for-each select="$mediaItems/node">
<img>
<xsl:attribute name="src">
<xsl:text>/umbraco/imagegen.ashx?image=</xsl:text>
<xsl:value-of select="current()/umbracoFile"/>
<xsl:text>&width=300</xsl:text>
</xsl:attribute>
</img>
</xsl:for-each>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
is the above 4.5 conversion correct. as it still does not work.
Hi Sajid
It seems to me that you should change <xsl:for-each select="$mediaItems/node"> to <xsl:for-each select="$mediaItems/Image">
Regards, Simon K
Hey Simon, thanx 4 yr reply. i did the conversion using the xslt converter package.
what u say is correct i changed it to this and it works:
?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:variable name="imageRoot" select="$currentPage/gallery"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<xsl:variable name="mediaItems" select="umbraco.library:GetMedia($imageRoot, true())"/>
<xsl:copy-of select="$mediaItems/Image"/>
<xsl:for-each select="$mediaItems/Folder/Image">
<xsl:variable name="picFile" select="umbracoFile"/>
<xsl:variable name="picW" select="umbracoWidth"/>
<xsl:variable name="picH" select="umbracoHeight"/>
<img>
<xsl:attribute name="src"><xsl:value-of select="$picFile"/></xsl:attribute>
</img>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Hi Sajid, you pointed out a real problem there. As I just wrote in another post:
"The problem with your suggestion is that replacing "$parent/node" with "$parent/*[@isDoc]" will cause problems if the <node> in question was a media-node. And as far as I can see right now, there is no easy way to determine this. One solution to work around this to give the user the option to run the converter in two different "modes", like "Documents" mode and "Media" mode.
I'll give this some thought and update the package in the next couple of days..."
Now, the problem is that my converter already replaces every occurence of "::node" with "*[@isDoc]". And as I wrote above, that's bad if it was a media-node.
Gotta fix that as soon as I can...
thanx for the reply Marcus
is working on a reply...