Skip to content

Instantly share code, notes, and snippets.

@RyanDurkin
Created September 30, 2012 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanDurkin/3808097 to your computer and use it in GitHub Desktop.
Save RyanDurkin/3808097 to your computer and use it in GitHub Desktop.
Product Price XML CT Source Code
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tcmi="http://www.tridion.com/ContentManager/5.0/Instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:tcmse="http://www.tridion.com/ContentManager/5.1/TcmScriptAssistant" exclude-result-prefixes="productPrice tcm tcmse xsl xlink tcmi xsd xhtml" xmlns:productPrice="uuid:341ebd00-fcf9-46d3-b4db-c8402acf798b">
<xsl:output method="xml" omit-xml-declaration="yes" version="1.0" indent="yes" cdata-section-elements="tcm_id product_tcm_id three_month_rate twelve_month_rate" />
<xsl:template match="tcm:Component">
<xsl:variable name="productPriceContent" select="./tcm:Data/tcm:Content/productPrice:Content" />
<xsl:element name="product_price">
<xsl:element name="tcm_id">
<xsl:value-of select="@ID" />
</xsl:element>
<xsl:element name="product_tcm_id">
<xsl:value-of select="$productPriceContent/productPrice:product/@xlink:href" />
</xsl:element>
<xsl:element name="three_month_rate">
<xsl:value-of select="$productPriceContent/productPrice:three_rate" />
</xsl:element>
<xsl:element name="twelve_month_rate">
<xsl:value-of select="$productPriceContent/productPrice:twelve_rate" />
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment