Jump to content

XML importing a container (again)


IdealData

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

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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