Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin 278 posts 662 karma points
    Jun 10, 2011 @ 12:46
    Martin
    0

    DAMP Media Picker

    Hi all, 

    Im new to umbraco and xslt, but i have an error coming up with the DAMP picker.
    My xslt has the following errors, but being new to xslt, i aint sure what it means.

    Ive followed the video tutorial from the DAMP site and evertthing seems to be the same.

    Im also getting an error displayed within the html

     

    Any help would be great

    Thanks

    Martin

    HTML

    Error parsing XSLT file: \xslt\DAMP.xslt

    XSLT

     

    Error occured

    System.OverflowException: Value was either too large or too small for an Int32.
    at System.Convert.ToInt32(Double value)
    at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
    at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)

     


    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <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="html" omit-xml-declaration="yes" indent="yes"/>
      
    <xsl:param name="currentPage"/>
    <xsl:template match="/">
      
      <!--In "classic" only 1 id can be stored.-->
      Classic:<br/><br/>
      <img src="{umbraco.library:GetMedia($currentPage/classic, 0)/umbracoFile}" height="329px;" />
      <br/><br/>
      <!--In "new" multiple media items can be stored with the full media xml.-->
      New:<br/><br/>
      <xsl:for-each select="$currentPage/new/DAMP[@fullMedia]/mediaItem/Image">
        <img src="{umbracoFile}" height="329px;"/>
        <br/>
        <br/>
      </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>

     

     

  • Sebastian Dammark 583 posts 1407 karma points
    Jun 10, 2011 @ 12:52
    Sebastian Dammark
    0

    Try doing like this instead

     

    <xsl:template match="/">
      <!--In "classic" only 1 id can be stored.-->
      Classic:<br/><br/>
        <xsl:apply-templates select="$currentPage/classic[normalize-space()]" />
      <br/><br/>
      <!--In "new" multiple media items can be stored with the full media xml.-->
      New:<br/><br/>
      <xsl:for-each select="$currentPage/new/DAMP[@fullMedia]/mediaItem/Image">
        <img src="{umbracoFile}" height="329px;"/>
        <br/>
        <br/>
      </xsl:for-each>
    </xsl:template>
    
    <xsl:template match="classic">
        <img src="{umbraco.library:GetMedia(classic, 0)/umbracoFile}" height="329px;" />
    </xsl:template>

     

    This way GetMedia is only called if classic has any data.

  • Sebastian Dammark 583 posts 1407 karma points
    Jun 10, 2011 @ 12:53
    Sebastian Dammark
    0

    Sorry ... like this:

    <xsl:template match="/">
     
    <!--In "classic" only 1 id can be stored.-->
      Classic:
    <br/><br/>
           
    <xsl:apply-templates select="$currentPage/classic[normalize-space()]" />
     
    <br/><br/>
     
    <!--In "new" multiple media items can be stored with the full media xml.-->
      New:
    <br/><br/>
     
    <xsl:for-each select="$currentPage/new/DAMP[@fullMedia]/mediaItem/Image">
       
    <img src="{umbracoFile}" height="329px;"/>
       
    <br/>
       
    <br/>
     
    </xsl:for-each>
    </xsl:template>

    <xsl:template match="classic">
           
    <img src="{umbraco.library:GetMedia(., 0)/umbracoFile}" height="329px;" />
    </xsl:template>

  • Martin 278 posts 662 karma points
    Jun 10, 2011 @ 13:21
    Martin
    0

    Thanks Sebastian, 
    That's solved it.

    I was refered to the DAMP picker from another forum post.

    I was looking to embed quicktime .mov files & im not too sure if it does.

    Can anyone clarify if they have embedded a .mov with DAMP

     

    Thanks

     

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 10, 2011 @ 13:27
    Jeroen Breuer
    0

    It doesn't embed quicktime movies out of the box, but with DAMP you can select a file from the media section which stores the movie. Than in xslt you can get the path to that movie, but you'll need to build your own player to load the movie into. DAMP is a media picker, but like other media pickers from Umbraco it just let's you select stuff. The rest you need to do yourself.

    Jeroen

  • Sebastian Dammark 583 posts 1407 karma points
    Jun 10, 2011 @ 13:31
    Sebastian Dammark
    0

    You could try this one: http://videojs.com/

    Remember to pick a solution ... :)

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jun 10, 2011 @ 13:43
    Jeroen Breuer
    0

    Perhaps this is the package that you might need instead of DAMP: http://our.umbraco.org/projects/website-utilities/html5-video

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft