Re: XMLlib library
Re: XMLlib library
- Subject: Re: XMLlib library
- From: Simon Forster <email@hidden>
- Date: Mon, 28 Apr 2014 09:46:52 +0100
On 27 Apr 2014, at 21:07, Wayne Melrose <email@hidden> wrote:
> Actually it simon thanks!
>
> I'd love to do it directly in a web viewer, the beauty of that is you can calculate the XML value directly into the webviewer.
>
> The problem I've been having with similar tests is getting the result out of the webviewer automatically. (Not manual cut/paste)
Copy and paste as a FileMaker script step:
Go to object //Go to webviewer object in appropriate layout
Select All
Copy
Paste //Into appropriate field
> FileMaker gives you a function to return the content of a webviewer, which (when calculating your HTML source within it) returns the original calculated HTML string,
FileMaker's various get... functions don't help too much here.
If your XML parsing is fairly trivial and you're able to share, I'd love to adapt it for a couple of examples I'm pulling together.
Simon
> not the returned content.
>
> But definitely got me thinking. :)
>
> Sent from my iPhone
>
>> On 28 Apr 2014, at 5:36 am, m Simon Forster <email@hidden> wrote:
>>
>>
>>> On 24 Apr 2014, at 23:47, waynemelrose <email@hidden> wrote:
>>>
>>> OK by request, here’s this question in a new thread .
>>>
>>> I have a need to parse XML. I’d like to be using Satimage’s scripting addition XMLlib. However, the parsing is to be done from a FileMaker button.
>>
>> Not really been following this thread. However, you can use Safari to parse XML and call that from an AppleScript:
>>
>> tell application "Safari"
>> set theResult to do JavaScript "
>> parseXml = function(xmlStr) {
>> return ( new window.DOMParser() ).parseFromString(xmlStr, 'text/xml');
>> };
>> var xml = parseXml('<foo>Stuff</foo>');
>> toReturn = (xml.documentElement.nodeName);
>> " in document 1
>> display dialog theResult
>> end tell
>>
>> And I imagine[1] you can do this within FileMaker using a web viewer object to do the parsing and then copy the text from the web viewer.
>>
>> Hope this fires a neurone in the right direction.
>>
>> ATB
>>
>> Simon
>>
>>
>> [1] I've got a trivial FileMaker solution parsing out text using grep in JavaScript. This is then used to create new records within FileMaker. I see no good reason that similar techniques can't be used to parse XML using JavaScript from within FileMaker.
>>
>>> So the code and scripting addition needs to be contained within the script. This means that storing it inside my own script bundle is not going to suffice. It needs to be contained within the FileMaker document. As I have mentioned, this is more about policy of not needing to install components on users machines.
>>>
>>> At this point, I think the answer is that it’s not possible. The only solution would be to store the XMLlib inside another bundle.
>>>
>>> At this point, I’m guessing it’s not going to happen. So at this point I guess I’m back to using System events XML parsing which, from memory doesn’t have xpath support?
>>>
>>> Thanks for all the replies!
>>>
>>> Wayne Melrose
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> AppleScript-Users mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>> Archives: http://lists.apple.com/archives/applescript-users
>>>
>>> This email sent to email@hidden
>>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden