IdealData Posted November 24, 2006 Posted November 24, 2006 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
beverly Posted November 24, 2006 Posted November 24, 2006 (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 November 24, 2006 by Guest
Wim Decorte Posted November 25, 2006 Posted November 25, 2006 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.
IdealData Posted November 25, 2006 Author Posted November 25, 2006 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
comment Posted November 25, 2006 Posted November 25, 2006 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
IdealData Posted November 25, 2006 Author Posted November 25, 2006 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?
comment Posted November 25, 2006 Posted November 25, 2006 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.
IdealData Posted November 25, 2006 Author Posted November 25, 2006 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.
cjaeger Posted November 27, 2006 Posted November 27, 2006 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.
comment Posted November 27, 2006 Posted November 27, 2006 You can IMPORT file references in to containers I don't see how you can import ANYTHING from XML directly into a container field.
cjaeger Posted December 2, 2006 Posted December 2, 2006 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
comment Posted December 2, 2006 Posted December 2, 2006 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now