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
Hi all,
I have created such structure for my flash xml file.
<gallery title="Standalone example" description="Slideshow example demonstrating event listeners."> <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']"> <album lgPath="http://localhost" tnPath="http://localhost" title="{data[@alias = 'albumTitle']}" description="{data[@alias = 'albumDescription']}"> <xsl:for-each select="$currentPage//node [string(data [@alias='umbracoNaviHide']) != '1']"> <xsl:if test="./data [@alias = 'video']"> <img src="{data[@alias = 'video']}" title="{data[@alias = 'title']}" caption="{data[@alias = 'caption']}" link="{data[@alias = 'link']}" target="_blank" pause="2" /> </xsl:if> <xsl:if test="node[./data[@alias = 'image']]"> <img src="{data[@alias = 'image']}" title="{data[@alias = 'title']}" caption="{data[@alias = 'caption']}" link="{data[@alias = 'link']}" target="_blank" pause="2" /> </xsl:if> </xsl:for-each> </album> </xsl:for-each></gallery>
and this xml file output the following xml:
<gallery title="Standalone example" description="Slideshow example demonstrating event listeners."> <album lgPath="http://localhost" tnPath="http://localhost" title="news" description="news description"> <img src="/media/890/1.f4v" title="flash" caption="flash" link="www.asp.net" target="_blank" pause="2"/> <img src="" title="flash" caption="flash" link="www.asp.net" target="_blank" pause="2"/> <img src="" title="title of the images" caption="caption of the images" link="www.asp.net" target="_blank" pause="2"/> <img src="/media/864/dsc_0060.png" title="title" caption="caption of the images" link="www.asp.net" target="_blank" pause="2"/> <img src="" title="title of the images" caption="caption of the images" link="" target="_blank" pause="2"/> <img src="/media/915/image.png" title="title of the images" caption="caption of the images" link="" target="_blank" pause="2"/> </album></gallery>
As you can see, there are some extra image tags which have no source?
I also created some nodes for xml file.
- Flash (xslt file located here)
- Month name (for example August 2010)
- Image node
- Flash node
Based on my xslt file, which lines should be adjusted?
thanx,
Hi ds,
Looks like you need to use a choose construct instead of 2 if statements:
<xsl:choose> <xsl:when test="./data [@alias = 'video']"> <img src="{data[@alias = 'video']}" title="{data[@alias = 'title']}" caption="{data[@alias = 'caption']}" link="{data[@alias = 'link']}" target="_blank" pause="2" /> </xsl:when> <xsl:when test="node[./data[@alias = 'image']]"> <img src="{data[@alias = 'image']}" title="{data[@alias = 'title']}" caption="{data[@alias = 'caption']}" link="{data[@alias = 'link']}" target="_blank" pause="2" /> </xsl:when> </xsl:choose>
/Chriztian
You'll also want to check the attribute for a value aswell. I belive you are currently just checking for the existance of the attribute, so you'll probably want to change the tests in Chriztians example to something like the following:
test="string-length(./data [@alias = 'video']) > 0"
Matt
Hi Chriztian,
I updated code;
<gallery title="Standalone example" description="Slideshow example demonstrating event listeners."> <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']"> <album lgPath="http://localhost" tnPath="http://localhost" title="{data[@alias = 'albumTitle']}" description="{data[@alias = 'albumDescription']}" tn="http://localhost"> <xsl:for-each select="node"> <xsl:if test="string-length(./data [@alias = 'image']) > 0"> <img src="{data[@alias = 'image']}" title="{data[@alias = 'title']}" caption="{data[@alias = 'caption']}" link="{data[@alias = 'link']}" target="_blank" pause="" vidpreview="/flash/gallery/album2/video/1_preview.png"/> </xsl:if> </xsl:for-each> <xsl:for-each select="node"> <xsl:if test="string-length(./data [@alias = 'video']) > 0"> <img src="{data[@alias = 'video']}" tn="http://localhost" title="{data[@alias = 'title']}" caption="{data[@alias = 'caption']}" link="{data[@alias = 'link']}" target="_blank" pause="" /> </xsl:if> </xsl:for-each> </album> </xsl:for-each> </gallery>
but video node does not work out.
Hi Matt,
I will also try your suggestion as well,
thanx
Chriztian,
Could you give me some hint for my updated code ?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to prevent displaying nodes twice?
Hi all,
I have created such structure for my flash xml file.
and this xml file output the following xml:
As you can see, there are some extra image tags which have no source?
I also created some nodes for xml file.
- Flash (xslt file located here)
- Month name (for example August 2010)
- Image node
- Flash node
Based on my xslt file, which lines should be adjusted?
thanx,
Hi ds,
Looks like you need to use a choose construct instead of 2 if statements:
/Chriztian
You'll also want to check the attribute for a value aswell. I belive you are currently just checking for the existance of the attribute, so you'll probably want to change the tests in Chriztians example to something like the following:
Matt
Hi Chriztian,
I updated code;
but video node does not work out.
Hi Matt,
I will also try your suggestion as well,
thanx
Chriztian,
Could you give me some hint for my updated code ?
is working on a reply...