topical media & game development

talk show tell print

mashup-amazon-12-12-03-CustomerMap-AmazonJSON.xsl / xsl



  <?xml version="1.0" encoding="utf-8"?>
  
  <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:a="http://webservices.amazon.com/AWSECommerceService/2005-10-05" 
    >
  
    <xsl:output method="html" omit-xml-declaration="yes"/>
    <xsl:template match="/">
      MyFunction( {"Customers" : [
      <xsl:apply-templates select="a:CustomerContentSearchResponse"/> ]
      } );
  
    </xsl:template>
  
    <xsl:template match="a:CustomerContentSearchResponse">
      <xsl:apply-templates select="a:Customers"/>
    </xsl:template>
  
    <xsl:template match="a:Customers">
      <xsl:apply-templates select="a:Customer"/>
    </xsl:template>
  
    <xsl:template match="a:Customer">
      {
      "CustomerId" : "<xsl:value-of select="a:CustomerId"/>"
      <xsl:apply-templates select="a:Location" />
      } ,
    </xsl:template>
  
    <xsl:template match="a:Location">
      , "City" : "<xsl:value-of select="a:City"/>",
      "State" : "<xsl:value-of select="a:State"/>",
      "Country" : "<xsl:value-of select="a:Country"/>"
    </xsl:template>
  
  </xsl:stylesheet>
  
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.