Waki Posted March 17, 2006 Posted March 17, 2006 Hi, i have to import this xml file, i can import all the data from pict node, but i don't find the way to import the image node, can someone help me? thank so much i attach my xml and xls file mosaic.zip
Wim Decorte Posted March 17, 2006 Posted March 17, 2006 Do you mean the data inside the "image" node, or import the physical image?
Waki Posted March 17, 2006 Author Posted March 17, 2006 no image, the "main" attributes is only a path for flash website, i need to make a record for every pict node, and a subrecord (if possible) for every image node. thanks
Fenton Posted March 17, 2006 Posted March 17, 2006 (edited) Pict and "image" would be 2 separate tables in FileMaker, parent and child. So you need 2 xml imports, each with its own xsl stylesheet, into its own table. The image xsl would be almost the same, just one more level down. Example: Notice that the attributes are almost the same. They just have an "i" in front. This can be easily done on a copy of the xsl using a text editor, such as BBEdit or TextWrangler (free) from http://www.barebones.com Find: @ Replace: @i You could leave the field names as they are, since they're in their own Images table. Also, I dropped the @year, and the final "." (who knows?), because they're not in the image data. Edited March 17, 2006 by Guest RECORDID="{position()}"
Waki Posted March 17, 2006 Author Posted March 17, 2006 thank you Fenton for your quickly replay. I've also thinked your solutions and it works well, the problem is that i have to edit the fm records (example i wanna add pict node to the xml to add pict to the website) and export back the xml for flash. Is there a way to export the same xml i have imported? thank so much
Fenton Posted March 18, 2006 Posted March 18, 2006 Yes, you can export the data back out. But what xml structure does the export need to be? I'm assuming that it would be different from the orignal xml (else why would you be asking)? Or is that you have the data in FileMaker originally, but want to export in the xml structure that you posted originally (but then why ask about importing it)?
Waki Posted March 18, 2006 Author Posted March 18, 2006 yes, i need to export in the same structure. The purpose is to permit to my customer, to modify or add picture to his site without use a xml editor (bbedit, oxygen) but with a more user friendly interface like filemaker. So i have to import in first time the original xml, edit, add, remove record (picture), and save again an xml to upload to the site. I have many website with this tecnology so this will be very useful for me. i attatch the original xml file, note that non every pict node will have a image node. thanks fendon for your interest mosaicOriginal.zip
Fenton Posted March 22, 2006 Posted March 22, 2006 Sorry to take so long. Yes, you can export out again, recreating the original xml. I was trying to come up with some kind of "generic and universal" xsl to do this, including related records, but was unable to do so. If anyone can do this (I think it can be done, but it's tricky), please post. Anyway, this is what I came up with. I'm assuming that you ONLY can have 2 Images. Otherwise you need to add another test. And I only put a few of the fields (columns), as it's tedious. But you can easily add. You do not need the FM Metadata, etc., in the export xsl. But you do need to see what the column order/numbers are. Do a raw xml export to see. <?xml version="1.0" encoding="utf-8"?>
cjaeger Posted April 11, 2006 Posted April 11, 2006 fenton, exporting XML will be much easier when you use the (depreciated, but much appreciated ) FMPDSORESULT grammar. that way you don't have to count on field order and can export/transform by (field)name.... MUCH more flexible when copying/modyfying scripts (provided you don't change your field names ....) and a lot easier to debug ...
Recommended Posts
This topic is 6802 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