At the moment I've written code in TroveProxy to fix these broken URLs, and it seems to me that the Trove API actually could incorporate this same fix, so I'd like to be able to move this fix "upstream" to Trove, so that other people who aren't using TroveProxy don't experience these broken links.
The XML response includes <records> elements with next attributes whose values are URLs which include a single category parameter whose value is a list of category names, separated by a (URL-encoded) comma. If I replace that category parameter with one whose value is taken from the code attribute of the parent (i.e. <category>) element of the <records>element, then the resulting URL does work.
At the moment I've written code in
TroveProxy
to fix these broken URLs, and it seems to me that the Trove API actually could incorporate this same fix, so I'd like to be able to move this fix "upstream" to Trove, so that other people who aren't usingTroveProxy
don't experience these broken links.The XML response includes
<records>
elements withnext
attributes whose values are URLs which include a singlecategory
parameter whose value is a list of category names, separated by a (URL-encoded) comma. If I replace thatcategory
parameter with one whose value is taken from thecode
attribute of the parent (i.e.<category>
) element of the<records>
element, then the resulting URL does work.e.g. take the following query URL: https://api.trove.nla.gov.au/v3/result?category=book&category=newspaper&q=water%20dragon&s=*&n=1&bulkHarvest=true
The result looks like this:
Those "next" URLs are broken, but if I change them like so, they do appear to work correctly:
The code I'm using to fix these broken URLs is here: https://github.com/Conal-Tuohy/TroveProxy/blob/0778f71bd4bf7146023e0972d3c08b7d4c2d16cc/src/xslt/fix-trove-response.xsl#L4 https://github.com/Conal-Tuohy/TroveProxy/blob/0778f71bd4bf7146023e0972d3c08b7d4c2d16cc/src/xslt/fix-trove-response.xsl#L13-L23