4 Replies Latest reply on Jan 12, 2007 8:52 AM by Newsgroup_User

    integrating xml file into coldfusion

    sudhakarjangam_SE
      Hi all,

      I need a syntax help for
      HOW TO INCLUDE .XML FILE INTO COLDFUSION.

      Thanks
      Sudhakar
        • 1. Re: integrating xml file into coldfusion
          Level 7
          HOW TO INCLUDE .XML FILE INTO COLDFUSION.

          <cfinclude template="aFile.xml">

          Would do just that. But this is probably not what you are trying to do.
          Give us a more specific question and we can probably help a bit better.

          Otherwise reading the entire chapters the CF documentation has on the
          many ways it can work with XML would probably help.
          • 2. Re: integrating xml file into coldfusion
            Abinidi Level 1
            Do a search for XMLParse(). XMLSearch(). You can also use CFFILE to read the xml file and then use XMLParse() to make a query object out of it.

            You can make an XML file using the CFXML tag also.

            There is alot of documentation on this subject, as it is widely used in CFML.

            • 3. Re: integrating xml file into coldfusion
              sudhakarjangam_SE Level 1
              Hi,

              Thanks a lot for your help.

              My requirement is:

              I want to store my own custom metadata with image.
              after uploading the image by the user,
              we need to give flexibility to the user to add/edit that metadata.

              The corresponding metadata tabs and fields were designed in coldfusion.
              Now how to integrate my custom metadata fields data what user edited, with image.

              sudhakar
              • 4. Re: integrating xml file into coldfusion
                Level 7
                The corresponding metadata tabs and fields were designed in coldfusion.
                Now how to integrate my custom metadata fields data what user edited,
                with image.


                You have two major techniques you can do this with ColdFusion. You can
                read/create the XML data into XML objects (not quite the same as a query
                objects - but similar) in the ColdFusion memory. You can then use the
                many xml, array and structure functions to manipulate these objects.
                Then use the toString() function to write out the final XML to files for
                long term storage.

                You can also use XML objects and|or strings with XSLT objects and|or
                strings to manipulate the data using the xmlTransform() function. I do
                this allot. You then have all the capability of XSLT and xPath syntax
                for changing XML data into new XML, XHTML or other forms. Again using
                <cffile...> tags to write out the resulting data to files.


                HTH