Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Nov 21, 2011 @ 14:29
    Tom
    0

    xslt Translation to razor?

    Hi i was just wondering how you'd translate something like this to razor as i'd be using it in a razor IF statement to then show the equivalent xslt:

     

    <?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:youtube="urn:youtube"
      exclude-result-prefixes="msxml umbraco.library youtube ">

      <xsl:output method="xml" omit-xml-declaration="yes"/>

      <xsl:variable name="field" select="/macro/field" />

      <xsl:param name="currentPage"/>

      <xsl:template match="/">
        <xsl:if test="string-length($field) &gt; 0 and string-length($currentPage/*[not(isDoc) and local-name() = $field]) &gt; 0">
          <xsl:variable name="item" select="youtube:GetMedia($currentPage/*[not(isDoc) and local-name() = $field]/value/@dataTypeId, $currentPage/*[not(isDoc) and local-name() = $field]/value)" />
          <xsl:value-of select="$item/EmbedCode" disable-output-escaping="yes" />
        </xsl:if>
      </xsl:template>

    </xsl:stylesheet>

Please Sign in or register to post replies

Write your reply to:

Draft