<xsl:value-of select="$media/@id" /> <!-- this works -->
<xsl:value-of select="$media/@nodetypealias" /> <!-- this does not -->
If I use <xsl:copy-of select="$media" /> I can see that the 'nodetypealias' attribute is there on the node, but I am unable to select it. Does anyone have any ideas why this could be?
Ha thanks Matt, just worked that out myself too. I was looking at the XML dumped out my <xsl:copy-of /> in Firebug and it had lower-cased all the damn attribute names! Very frustrating waste of time as I was trying to work out what was wrong with my XPath queries!
Problems getting attributes with getMedia()
I'm trying to get an attribute of a media node but for some reason it's not returning anything. Strangely the 'id' attribute returns a value.
<xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/data [@alias = 'mediaId'], 0)" />
<xsl:value-of select="$media/@id" /> <!-- this works -->
<xsl:value-of select="$media/@nodetypealias" /> <!-- this does not -->
If I use <xsl:copy-of select="$media" /> I can see that the 'nodetypealias' attribute is there on the node, but I am unable to select it. Does anyone have any ideas why this could be?
Hi Alex,
First thing I would try is to use the alias @nodeTypeAlias (that exact casing) as this is case sensitive.
If that's not the case, can you let us know version of Umbraco you are using?
Matt
Ha thanks Matt, just worked that out myself too. I was looking at the XML dumped out my <xsl:copy-of /> in Firebug and it had lower-cased all the damn attribute names! Very frustrating waste of time as I was trying to work out what was wrong with my XPath queries!
is working on a reply...