This project is read-only.

How to use portal-image-size?

Dec 28, 2010 at 1:51 PM

Hi Anton,

I'm trying to use this new function, but with partial success: I cannot get XML output, only see text values.

What I do is like this:

I call the function to get size of a file in a specific folder (Portals\n\XSLideShowThumbnails\filename):

<xsl:variable name="dimensionireali">{{mdo:portal-image-size(concat('XSLideShowThumbnails\', $imgFileName))}}</xsl:variable>

 then I try a node-set above the result, which should be an xml document:

<xsl:variable name="rd" select="mdo:node-set($dimensionireali)"></xsl:variable>

But then if I try to get data, I don't get anything:


<xsl:attribute name="heightrd">{{$rd//height}}</xsl:attribute>


I also noticed that if I print the output of portal-image-size call, I cannot see the xml but only text of values, e.g. a string like "8006004096" where should see 800 for width, 600 for height and 4096 for size.

I also tried to put this call inside an xml mdo:service, but again can only see text of values and not full xml.

Can you tell what am I missing?




Dec 28, 2010 at 4:35 PM


portal-image-size returns XML ready to be used in XPath:

<xsl:variable name="dimensionireali" select="mdo:portal-image-size(concat('XSLideShowThumbnails\', $imgFileName))" />

Width: {{$dimensionireali//width}}<br/>
Height: {{$dimensionireali//height}}<br/>