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.

XML importing a container (again)

Featured Replies

I asked this one last week but still no joy, so this is a re-post hoping that others might contribute.

My attachment is a simple example and, theoretically, should import a container. The test suite is complete with all files.

Many thanks in advance

XML_Test.zip

Actually, I did answer... answer

You cannot import BLOBs (container type stuff) with XML. You can import TEXT (dates, number are text, too). If you import the file name and create a calculated container with the path and image name (imported into field), you should be able to see the image.

Edited by Guest

The thing to remember is that an xml file is just pure text. So it does not contain objects like a binary file does (jpg, mov, ...)

as such you can import just the text.

  • Author

Thanks for the replies but there's still something missing in the whole equation (I hoped you would have fixed my example to show how it is done) because the XML docs from FMP clearly state:

Note: The content of picture fields will be in the form of a relative URL used for retrieving the image.

and that is what I have done. I also specified it to be a CONTAINER (see the attachment for the full DTD), and I appreciate that this is not specifying a BLOB, however a path to the BLOB

I cannot specify it be text and import into a text field because AFAIK there is no funtion in FMP to provide a container result from a file or path reference provided in another field.

I agree you can extract the file and path info from a container using GetLayoutObjectAttribute, however there doesn't seem to be a way to force the file/path info into the container.

If FM documented then I expected it should work :) or have I misunderstood?

Most appreciated if any one knows how to do it - maybe you can fix my example.

fmpxmlresult_dtd.htm.zip

I agree you can extract the file and path info from a container using GetLayoutObjectAttribute, however there doesn't seem to be a way to force the file/path info into the container.

You can extract the file and path info from a container field into a text string using GetAsText (Container). And it works in the opposite direction, too - see attached.

XML_Test.zip

  • Author

Thank you so much comment.

I had been fooled by the FM docs. Why do they list CONTAINER as a valid element type in the DTD?

It is valid - the question is where and for what purpose. Don't forget that the FMPXMLRESULT grammar contains not only data, but also structure. If you take your original .xml file and have Filemaker open it directly, a new database will be created for you - and it WILL have a container field (with no data).

If FMI had finished the job, you could conceivably have an XML file somewhat like this:






   

   

      

         

            

            

            ...

         

      

      

      

         

            

            

            ...

         

      



   

   

   

   

      

         

            12345

            ...      

so you could put practically your entire file into XML, and have it recreated (perhaps minus the graphic work) on the other side.

  • Author

So...

Although the DTD lists CONTAINER it's about as much use as a chocolate fireguard!

Sounds like a little bit of unfinished work at FMI.

Nice thought with the entire DB being defined in an XML.

Thanks for the solution though.

You cannot EXPORT container fields directly, but a calculated TEXT field containing a file/image reference. (imagemac:/Macintosh HD/Users/cjaeger/pic.jpg). You can IMPORT file references in to containers no prob.

You can IMPORT file references in to containers

I don't see how you can import ANYTHING from XML directly into a container field.

I don't see how you can import ANYTHING from XML directly into a container field.

Give THIS a try. You can import any TEXT into a container field.

XSLcontainer.fp7.zip

Hmm, interesting. When I tried the same thing before, Filemaker wouldn't let me pick a container field as the target field. It does now, so I must have done something wrong then. Thanks for clarifying.

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.