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

XML importing a container (again)


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

Recommended Posts

Posted

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

Posted (edited)

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
Posted

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.

Posted

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

Posted

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

Posted

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?

Posted

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.

Posted

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.

Posted

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.

Posted

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.

This topic is 6564 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.