2 Replies Latest reply on Dec 15, 2016 4:40 AM by beverly

    nested xml export

    rremde

      I am returning to FMP after a 20 year absence, and I'm trying to figure out if Filemaker can do what we need to do.

       

      We are a film company, and produce streaming film channels.  We need to produce MRSS (media RSS feeds) that match the format below.  The regular .xml is pretty straightforward, but I'm not sure how to replicate the nested data - is this something we can create from FMP.  If anyone can point me in the appropriate direction, I'd be grateful.

       

      <channel>

       

      <irc:gridrowtitle>Two Item List</irc:gridrowtitle>

       

       

      <item>

       

       

      <irc:shortdescriptionline1>ITVC Demo Item 1</irc:shortdescriptionline1>

       

      <irc:shortdescriptionline2>Created using the ITVC MRSS Generator</irc:shortdescriptionline2>

      <irc:title>Instant TV Channel Demo One</irc:title>

      <irc:poster>http://ex.irchan.com/misc/clockhead_269x152.png</irc:poster>

      <irc:url>http://ex.irchan.com/mp4/kodak.mp4</irc:url>

      <irc:streamformat>mp4</irc:streamformat>

      <irc:artist>Salvadore Dali</irc:artist>

      <irc:description>Spiffy new Kodak Flash Cubes for your camera!</irc:description>

      <irc:categories>ITVC, Camera, Flash</irc:categories>

      <irc:length>60</irc:length>

      <irc:releasedate>2001</irc:releasedate>

      <irc:actors>Joe March, Sally April, Jim Link</irc:actors>

      <irc:rating>Totally Unrated</irc:rating>

      <irc:director>Igor Stravinsky</irc:director>

      <irc:audioformat>dolby-digital</irc:audioformat>

      <irc:hdbranded>true</irc:hdbranded>

      </item>

       

      <item>

       

       

      <irc:shortdescriptionline1>ITVC Demo Item 2</irc:shortdescriptionline1>

       

      <irc:shortdescriptionline2>Also created using the ITVC MRSS Generator</irc:shortdescriptionline2>

      <irc:title>Instant TV Channel Demo Two</irc:title>

      <irc:poster>http://ex.irchan.com/misc/energy_269x152.png</irc:poster>

      <irc:url>http://ex.irchan.com/mp4/peaches.mp4</irc:url>

      <irc:streamformat>mp4</irc:streamformat>

      <irc:artist>M. C. Escher</irc:artist>

       

      <irc:description>

       

      Enjoy these sweet and tasty canned peaches. The password is abc.

      </irc:description>

      <irc:categories>ITVC, Peaches, Sweet</irc:categories>

      <irc:length>60</irc:length>

      <irc:releasedate>2000</irc:releasedate>

      <irc:actors>Joe May, Sally June, Jim Lock</irc:actors>

      <irc:rating>TV-G</irc:rating>

      <irc:director>Sven Argot</irc:director>

      <irc:hdbranded>false</irc:hdbranded>

      <irc:password>abc</irc:password>

       

      <irc:midrolls>

       

       

           <irc:midroll>15</irc:midroll>

       

           <irc:midroll>30</irc:midroll>

           <irc:midroll>120</irc:midroll>

      </irc:midrolls>

      </item>

      </channel>

       

       

        • 1. Re: nested xml export
          nicolai

          rremde

          There are two ways

           

          You can assemble your XML as text using text functions with a calculation or script. You can export it as a text file with .xml extension.

           

          A better way, but it requires some learning,  is to use Export XML using XSLT. You will need to learn some basic XSLT and xPath. If you are going this way, you can export xml at <item> level and combine into <gridrowtitle> with <xsl:for-each>, which is similar to FileMaker Loop.

           

          XSLT will allow you to change the namespace into "irc:" as well.

           

          There is a great book on FileMaker XML/XSLT, ignore the old version of FileMaker in title:

           

          https://www.amazon.com/FileMaker-Developers-Guide-Wordware-Library/dp/155622043X/ref=sr_1_1?ie=UTF8&qid=1481801863&sr=8-…

           

          There are also a few templates, you can try them as a starting point.

          1 of 1 people found this helpful
          • 2. Re: nested xml export
            beverly

            nicolai is correct. the calculated XML would probably need a nested loop to give you the text for the nested XML.

             

            try to think in terms of how you would just "gather" the text and then add the xml-tags around those fields and/or calculations.

             

            beverly

            2 of 2 people found this helpful