john renfrew Posted December 5, 2012 Posted December 5, 2012 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
Recommended Posts
This topic is 4439 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now