July 22, 201510 yr (Posted too quick, should probably be moved to Importing & exporting > XML/XSL) Hi All I'm trying to import and XML data source but am having problems getting the data in. I can download the XML locally and import it with my XSL without a problem. I've also tested the URL generated by the script on http://www.freeformatter.com/xsl-transformer.html successfully. I can view the URL in a web viewer object OK. It fails when I try to import AND when I try to insert from URL into a text field. I've tried various combinations of encoded/decoded characters in the URL but no luck yet. Open to any suggestions (except download it locally and then import it... I could script it with wget but that's an extreme last resort) URL calculation was initially generated by doing a manual search on http://www.nla.gov.au/apps/srw/search/peopleaustralia and copying the resulting URL into a calculation and then substituting field names where relevant. Sample URL: http://www.nla.gov.au/apps/srw/search/peopleaustralia?query=bath.name+%3D+"Bruce"&version=1.1&operation=searchRetrieve&recordSchema=info:srw/schema/1/dc-v1.1&maximumRecords=10&startRecord=1&resultSetTTL=300&recordPacking=xml&recordXPath=&sortKeys= (double quotes are also encoded) My XSLT: http://files.digitisation.unimelb.edu.au/xsl/nla-peopleaustralia-dc-fm12.xsl Diagnostics in text field inserted from URL <?xml version="1.0" encoding="UTF-8" ?> <searchRetrieveResponse xmlns="http://www.loc.gov/zing/srw/"> ... <diagnostics xmlns:ns2="http://www.loc.gov/zing/srw/"> <ns3:diagnostic xmlns:ns3="http://www.loc.gov/zing/srw/diagnostic/"> <ns3:uri>info:srw/diagnostic/1/10</ns3:uri> <ns3:details>expected boolean, got string: "Bruce"</ns3:details> ... Sample database attached. Lookup script puts the URL in a text field, the web viewer and Insert from URL into the adjacent text field. The text field and web viewer should display the same data NLA_PeopleAustralia.zip Edited July 22, 201510 yr by Ben Kreunen
July 22, 201510 yr Author Yes. Thanks. It's not the same URL that their form returns but it also makes sense. Should have thought of that ;-)
July 22, 201510 yr It's not the same URL that their form returns Well no, because I assumed they will supply the defaults if you don't override them explicitly. But the main point here is that you shouldn't escape the quotes or the = sign.
July 22, 201510 yr Author I had tried it with a decoded URL, but not with single quotes... yes, I was too focused on one problem and not thinking about what I "should" have been using.
July 23, 201510 yr I had tried it with a decoded URL, but not with single quotes It will work with double quotes just as well: Let ( [ template ="http://www.nla.gov.au/apps/srw/search/peopleaustralia?query=bath.name=\"$name$\"" ] ; Substitute ( template ; "$name$" ; Table::gSearchName ) ) I chose single quotes purely for convenience, to avoid the escaping within Filemaker.
July 23, 201510 yr Author Built some more complex searches but used http://www.url-encode-decode.com/ to avoid making mistakes ;-) Back on track now. Adding in optional criteria if available/relevant to narrow down the data retrieved eg. person was alive in the same decade of publication of journal article (for authors)... I think I'll switch to using multiple templates as in your example for the different components to reduce the clutter in the calculation for debugging.
Create an account or sign in to comment