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 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 " ">]><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) > 0 and string-length($currentPage/*[not(isDoc) and local-name() = $field]) > 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>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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 " ">
]>
<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) > 0 and string-length($currentPage/*[not(isDoc) and local-name() = $field]) > 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>
is working on a reply...