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.

import xml with attributes ?

Featured Replies

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

Do you mean the data inside the "image" node, or import the physical image?

  • Author

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

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 by Guest
RECORDID="{position()}"

  • Author

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

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)?

  • Author

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

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"?>

  • 3 weeks later...

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

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.