Transforming Product Advertising API Responses into HTML Using XSLT
Perhaps you want to use a different set of tags in Product Advertising API responses than those that are returned by default. For example, because you want to display responses on a web page, you want to turn the responses into HTML. You have two choices: you can receive the default Product Advertising API response and then transform it into HTML (or another set of XML tags) or you can tell Product Advertising API to do the transformation for you so that the result is ready for you to use. To make Product Advertising API do the work for you, you just need to reference an XSL stylesheet in your Product Advertising API request.
Product Advertising API provides an XSLT (Extensible Stylesheet Language Transformation) service to ensure that even novice developers can produce rich content without complex parsing or programming. XSL is an XML-based language for transforming XML tags into HTML or any other set of XML tags. To use the Product Advertising API XSLT service, the request must be in REST, and the XSL style sheet must be referenced using the Style input parameter.
To transform the response
-
Include the
Style
parameter in your request.The referenced stylesheet must be publicly accessible.
For example, the following ItemSearch
request specifies the XSLT
stylesheet http://ecs.amazonaws.com/xsl/aws4/item-search.xsl.
http://ecs.amazonaws.com/onca/xml? Service=AWSECommerceService& AWSAccessKeyId=[AWS Access Key ID]
& Operation=ItemLookup
& IdType=ASIN& ItemId=B00008OE6I& ResponseGroup=Large& Style=http://ecs.amazonaws.com/xsl/aws4/item-search.xsl