SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Eugene, Oregon
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    &Style parameter and Amazon Web Services

    I am querrying Amazon's product list in order (eventually) to make sales as an Associate (My company already is one). I can create querrys to extract the information I want just fine, and display the document tree no problem. When it comes to displaying the information (with XSL, of course) I get stuck.

    Amazon's Web Services says to just add the style parameter, as in the last line of the example REST query.

    http://webservices.amazon.com/onca/x...ommerceService
    &SubscriptionId=[your subscription ID here]
    &Operation=ItemLookup
    &IdType=ASIN
    &ItemId=B00008OE6I
    &ResponseGroup=Large
    &Style=http://www.yourdomain.com/your-xsl-style-sheet.xsl

    When I replace the style parameter with
    &Style=http://www.bruteepicure.com/IIDJ/item-search.xsl
    which is a fully qualified path, I still do not return a formatted result.

    Am I missing something to do with declaring a stylesheet namespace. The top of my style sheet looks like this:

    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlnssl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:aws="http://xml.amazon.com/AWSECommerceService/2004-08-01">

    <xsl:template match="aws:ItemSearchResponse">
    .....

    You can see all of this in action at http://www.bruteepicure.com/IIDJ/GermanDesignBooks.html
    I am concerened first with the top-most navigation link, 'Fully Qualified US Version'.

    I think somewhere I'm missing something really simple, as this process isn't all that hard. Another set of eyes would help a lot.

    Cheers,
    Werd

  2. #2
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your namespace has to end in 2005-03-23, not 2004-08-01. If you view source on any of the requested pages, you'll notice that the namespace THEY use is 2005-03-23, and therefore you have to use the same -- otherwise all the variables you expect to be around will be empty.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Eugene, Oregon
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks someonewhois, your a champion,
    But I am still not returning a formatted result.

    As you said the xml namespace returned is 2005-03-23, so I am trying two different stylesheets:

    trial 1: from 'Format with search.xsl', as per the returned namespace:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0"
    xmlnssl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns="http://webservices.amazon.com/AWSECommerceService/2005-03-23">

    <xsl:template match="aws:ItemSearchResponse">
    ...

    trial 2: from 'Format with 'iidjspace.xsl', as per the web services example
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0"
    xmlnssl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:aws="http://xml.amazon.com/AWSECommerceService/2005-03-23">

    <xsl:template match="aws:ItemSearchResponse">
    ...

    So I wonder what else could I be missing? All examples can still be found at http://www.bruteepicure.com/IIDJ/GermanDesignBooks.html

    The path test is curious too. It is valid, but the stylesheet, copied verbatum from the Amazon web services example, does not appear to be valid. But that's a problem for a different day.

    Thanks for your help.
    Werd

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Eugene, Oregon
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My REST query still looks as it did before:

    <p><a href="http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&Operation=ItemSearch&SubscriptionId=0TK96AHTX9FDTF7V6Q82&version=2005-03-23&Keywords=Germany,Design&SearchIndex=Books&ResponseGroup=Medium&Style=http://www.bruteepicure.com/IIDJ/item-search.xsl" target="Frame">Format with item-search.xsl</a>
    </p>

    The top of my stylesheet in use to format REST requests to Amazon's product catalog looks like this:

    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0"
    xmlnssl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns="http://webservices.amazon.com/AWSECommerceService/2005-03-23"
    xmlns:aws="http://xml.amazon.com/AWSECommerceService/2005-03-23">


    In the returned REST request it appears as though the version matches that in the stylesheet:

    <?xml version="1.0" encoding="UTF-8" ?>
    - <ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2005-03-23">
    - <OperationRequest>

    When I open the REST request in an inline frame I do not however, return formatted results. The stylesheet is well formatted, and element name match those in the REST request. Yet the results are not returning formatted. What am I missing?

    Thanks, Andrew


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •