December 5, 201213 yr Been playing around with InsertFromURL and XML CWP so started by writing a simple function to parse the returned result (SO much easier in Groovy than writing parse functions in FM) and realised it is also possible to to both in one go So if you are a code hoarder like me here it is... // FMurlXML ( fm_url ) // 12_12_05 JR // either runs CWP script and returns error code and version // or just parses the code from the result of InsertFromURL // fm_url is either a formed url - http://yyy.xxx.com/fmi/xml/fmresultset.xml?-db=plug&-lay=tzt&-view&-script=txt or the XML results if (fm_url[0..3] == 'http'){ root = new XmlParser().parseText(fm_url.toURL().text) } else { root = new XmlParser().parseText(fm_xml) } version = root.product.@version return root.error.@code John
Create an account or sign in to comment