Closed tomkinsc closed 11 years ago
Yeah the original link doesn't work properly with ItemSearch. The raw.github.com link didn't work for me, btw. I just hosted the file in my WordPress blog for now. Here's the link if anyone wants to use it for testing: http://www.calazan.com/wp-content/uploads/2012/03/xml2json.xslt
Hmm, I can't get that XSLT to work with any requests now. Anyone else?
Me neither.. I was counting on this one. We don't have to explicitly do json.loads() after this, do we?
I've been unable to make XSLT work in the latest bottlenose.
I'm confused: commit cf50e0b36053cf9a69fd51a7cf1851e7c0e35ef8 claims to "update README since XSLT is no longer supported" - yet the API still supports the Style=
parameter.
Why does the bottlenose API accept the Style
parameter if XSLT is no longer supported? Or have I misunderstood the commit message?
@inactivist It's my mistake--I haven't removed the parameter itself from the __init__
method. The Style parameter is no longer supported in any capacity.
BTW, closing since Style is no longer supported.
The Style parameter is no longer supported in any capacity.
@dlo: Thanks for the update. What was the reason for dropping the XSLT support? If this has been discussed elsewhere, please provide a link.
@inactivist I tried to find a thread posted by Amazon itself, but couldn't find one. Here's a post by one of the users of the API on the AWS Product Advertising API forum: https://forums.aws.amazon.com/thread.jspa?messageID=369494
I actually liked the style parameter. I suppose we could "fake" it by running an XSLT transform locally, but I haven't written any code to handle that lately and have just gotten used to using lxml to parse the responses.
@dlo Thanks for the pointers. I liked the ability to use the XSLT to turn XML into JSON, because like you, I don't care much for XML...
I'll check out LXML...
I was able to use lxml, but it seemed a bit cumbersome. I'm considering performing the XSLT transform locally as you mentioned earlier.
In the meantime, xmltodict -- found in this SO answer -- appears to be a fine alternative; it converts XML strings into nested OrderedDict
instances. This is nearly identical to what simplejson.loads()
was doing with the XSLT-transformed JSON strings we were getting when we used the Style=
parameter with the XML-to-JSON stylesheet.
See: https://github.com/dlo/bottlenose/issues/2
The example on the bottlenose readme still includes the URI to the "broken" XSLT:
Can we add an attribution link in the readme for the xml2json.xslt Google code project, and then change the example Style to point to the new xml2json.xslt file?