WingMaker Posted February 23, 2010 Posted February 23, 2010 Hi all, Is it possible to create one parent record and then create multiple child records based on the XML file? Ricky
comment Posted February 23, 2010 Posted February 23, 2010 What XML file? If you have a XML file with parent and child structure, you can import it twice - using a different stylesheet for each target table.
WingMaker Posted March 4, 2010 Author Posted March 4, 2010 (edited) Attached is an example of the xml file that I am using. I need to create a stylesheet to import into filemaker. Some of the elements in the xml file do not read for filemaker. And sometimes there could be more than one article. <?xml version="1.0" encoding="utf-8"?> Cengage EPAC-123456789 Cengage Jimmy Page 145 Dart Ave Akron 44301 OH USA false 2 1432 2 9781234567890 Three Cups Of Tea Jeff Beck Cengage 0.466 7.95 25 12345 11.925 1432 2 25 Edited March 4, 2010 by Guest
comment Posted March 4, 2010 Posted March 4, 2010 The way it looks there can be multiple Articles and multiple Packages - and each package can have multiple PackageLines. You need to specify what do you want to import into which table.
WingMaker Posted March 4, 2010 Author Posted March 4, 2010 Essentially there would be three tables... One for the ShippingAddress or what should be the top level table. The xml should import once into this table. A table for the articles with the FK of the ShippingAddress table. The xml should import the articles into this table. Then import the packages into a table. With FK of the articles. Could I do all this in one import with one stylesheet or do I need to do multiple things? thanks
comment Posted March 4, 2010 Posted March 4, 2010 Filemaker cannot import into more than one table at a time. You need a specific stylesheet for each table. Attached are two sample stylesheets, one for importing the order and one for the articles. Then import the packages into a table. With FK of the articles. I don't see that Packages have a FK to Articles - only PackageLines do. Anyway, I believe this should be enough to get you started. Archive.zip
WingMaker Posted March 4, 2010 Author Posted March 4, 2010 I suppose I can add the packages along with the article because it carries the same articlenumber or can I import the package using the article number? And Thank you very much for all of this.
comment Posted March 4, 2010 Posted March 4, 2010 From what I see in the sample, an Article could be split into several PackageLines - and these lines could be in the same Package and/or in different Packages. I am not sure what you intend to do with the imported data. If you want to preserve the original structure, then you need 4 tables and 4 imports.
WingMaker Posted March 4, 2010 Author Posted March 4, 2010 I see now, I will create four tables each for the elements, address/article/package/packagelines. and have four imports. thank you
WingMaker Posted March 4, 2010 Author Posted March 4, 2010 In the Articles element is says 25 I know the value is 25 but could I grab the ordered value "50"? thanks
WingMaker Posted March 5, 2010 Author Posted March 5, 2010 thank you Even though this is a physical file for import, how does HTTP request work? What url do you put in for the Import XML script step? RB
Recommended Posts
This topic is 5375 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