Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script import of XML to FMP from a folder?

Featured Replies

I am working through importing 1000+ XML files exported from FirstClass. I have a working XSLT doc, that works with FMP8 when I use the Open-XMLSource menu. I now have these questions:

1-Is there a way to automate importing from a folder of 1,000+ xml files? I know I can script the import in FMP, but I don’t know how to loop through a folder – is that possible?

2-I was able to import all the fields from the XML FC file, but they have some info that is stored in the

of the record, and has no field ID. Is there anyway to import that info? A way to call it in the stylesheet?

3-Is it possible to retain formatting when exporting to XML and back into FMP (bold, underline, italics)?

Any help or direction would be great - thx!

1- you'll need to use some OS scripting to do this (loop through each file in the folder, rename it to the name that is hard coded in the FM import script, trigger the FM import)

2- hard to say without seeing the XML file. But I'm sure the XSL can be modified to add the text in the body to the correct record

3- No. XML is pure text. FirstClass would have to add formatting tags to indicate where the formatting was .Maybe they don't and even if they did, FM has no way of interpreting those tags. If the tags were there you could probably write a monster script in FM to put the formatting back.

  • Author

; I am still trying to figure this out. THX!

XML File:

<?xml version="1.0"?>

33

2

15

2

Central Mailbox

105

-

0

0

0

----STUDENT SELF-EVALUATION----

If you're not up for a full wolf-viewing program, you can do pretty well on your own by driving into the Lamar Valley (the road is kept open in winter) and looking for clusters of parked cars and big spotting scopes on tripods. These belong to the wolf watchers, sometimes called "wolfies" -- amateur enthusiasts who flock to Yellowstone to observe and keep tabs on the animals.

----TEACHER NARRATIVE EVALUATION----

Wolves,

Wolves are typically larger than coyotes, but from a distance it's sometimes hard to tell them apart -- until you pay attention to their body language.

For the first decade after reintroduction, Yellowstone's wolves multiplied and thrived. From a start of 31 wolves, the park's population had grown to 171 by 2004.

What does this XML represent? One record? And the data associated with the field IDs go into fields for that record?

  • Author

This is one record. There is an export from FirstClass of about 1000+ XML docs, which I am importing with a style sheet into FMP. The XML above is an abbreviated XML doc (there are about 300 fields); and yes, each field ID goes with one field in FMP. I was able to use my style sheet with no problems, on all of the fields, but cannot find a way to get the recognized and imported. I am also still looking for a way to handle the 1000+ records since FMP does not allow importing from a Folder when using XML docs.

I don't have any problem (other than the bunch of extra paragraph returns that are in the original text) just using:

It is not inside the element.

As far as importing all the xml docs from a folder, I would recommend upgrading to FileMaker 8. It allows you to set a script Variable with a file path, which can then be used to import a single file.

Then it's just a question of getting the filepaths. Look at this thread:

http://fmforums.com/forum/showtopic.php?tid/173921/post/194001/hl/+Fenton/#194001

Attached is a sample FP7 file and an XSLT that transforms the source XML you posted into that demo file. Let me know if it helps.

Here's the XSLT code I used.

<?xml version='1.0' ?>



 

  

   0

   

   

   

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

   

   

    

     

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

      

       

        

       

      

     

    

   

  

 



firstClass.zip

  • 1 month later...
  • Author

Wim and Fenton:

Just a follow-up - THANKS to both of you!

I was able to use the style sheet sample (with some modifications) from Wim and the thread content for the looping through a folder, from Fenton. The loop was a little tricky since I needed to translate using my style sheet and the Import XML script versus a straight import, but I finally got it working. The main thing was that I had to edit the Applescript MacPath differently for the import XML from file command.

Regardless - it all works and I learned a ton. Thanks again.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.