Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Script import of XML to FMP from a folder?


This topic is 6813 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted

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.

Posted

; 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.

Posted

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.

Posted

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

Posted

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...
Posted

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.

This topic is 6813 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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