2 Replies Latest reply on Jun 25, 2013 9:34 PM by MW Design

    I need to know how to import xml files into indesign cs6.

    sally_g Level 1

      My client wants to send me xml text files to import into Indesign for a multi-page publication. I don't have a clue where to start. Can you point me to a tutorial that would help me figure this out?


      I have a sample file that looks like this:

      <?xml version="1.0"?>
          <name>Bow Valley College</name>
          <description>Putting the Community back in college&#x2026;in the Bow Corrid




      Designated as the comprehensive community college for Calgary &amp; its
      surrounding region, Bow Valley College offers you learning opportunities
      through flexible delivery options, including classrooms, online or self
      paced modules. Whether you are taking a course for interest, to enhance
      your career skills or to finish high school you have access to all of the
      traditional Bow Valley College student supports.


      Visit our website [2] or come see us at our Canmore campus.




      [1] http://www.bowvalleycollege.ca/bow-corridor.html
          <contact_information>Canmore Campus
      Provincial Building, 800 Railway Ave.
      Canmore, AB&#xA0; T1W 1P1


      OFFICE HOURS: 8:30am - 4:30pm, Monday - Friday (except from 12 - 1pm)


      PHONE: (403) 678-3125
      FAX: (403) 678-3127


      BANFF CAMPUS: Lower Level, Banff YWCA, 102 Spray Ave., Banff (ONLY OPEN
      WHEN COURSES OFFERED).&#xA0;</contact_information>
          <registration_information>Cancellation policy: Once your course has begun no refunds or credits will
      be given. Compassionate grounds may be considered with official
      documentation. There are no refunds, transfers, or credits if you cancel
      within one week of the course start date.


      BY PHONE: (403) 678-3125. Payment by Visa or Mastercard
      IN PERSON: Canmore Campus, Provincial Building, 800 Railway Ave., Canmore.
      Payment by cash, Visa or Mastercard.




      COURSES. PLEASE ASK FOR MORE INFORMATION.</registration_information>
              <title>Computer Basics/Windows 7 - Instructor led, Canmore</title>
              <description>An instructor will lead the class through the basic features of Microsoft
      Windows, the Internet and Email. Find out how to start programs, create,
      save and organize your files and use the online help feature. You&#x2019;ll also
      get an introduction to surfing the internet and setting up an email
      account. This course is designed for those with little or no computer
      experience &#x2013; and is still our most popular course. 18 HR COURSE.</description>
                  <date>Mon 6:30 - 9 pm, Oct 7 - Dec 2</date>
                  <date>Thu 6:30 - 9 pm, Oct 10 - Dec 5</date>
              <title>Word 2010 Introduction - Self-paced</title>
              <description>Explore the basics of Microsoft Word to produce professional letters and
      documents. This course guides you through the effective use of the Word
      Ribbon and Quick Access Toolbar. You&#x2019;ll learn how to efficiently edit,
      move and copy text; manipulate fonts; apply bullets and numbering; borders
      and shading; insert and re-size Clip Art; enter headers and footers; insert
      page numbers; set alignment and indents; and change page settings. You&#x2019;ll
      learn to use the AutoCorrect feature and finish documents using the
      spelling, thesaurus and grammar features.
      Self-paced, 18 hr course.
      Prerequisite recommended: Computer Basics or equivalent experience.</description>
                  <date>Mon 7:30 - 9 pm, Oct 7</date>
                  <date>Thu 7:30 - 9 pm, Dec 5</date>





        • 2. Re: I need to know how to import xml files into indesign cs6.
          MW Design Level 5

          Hello Sally,


          First, I have only heard/read good things about the book Steve recommends. It is on my to buy list one day. Been awaiting a long deserved vaction to pick it up to read.


          I approach XML files pretty much like I do any text file I am sent in that I will import or copy/paste a text file into a frame in ID and begin setting my styles. With XML, though, I first clean it up, move closing tags up to their logical close lines, remove spurious codes that mean something in HTML but don't necessarily belong in the XML file (like &#x2019 which is an apostrophe so I do a search and replace. But for &#xA0; which is a non-breaking space I simply search and replace with a regular space in general), and make sure the XML validates.


          Validation is much like making sure an HTML page is formed properly. I use an XML editor (XML BluePrint) and a text editor (UltraEdit) for these tasks. If I had to only have one or the other, I suppose the XML editor is what I would use.


          I always show the import options when I import the XML and make sure that I link to the file.


          So once a sample of the XML is on a page in ID (via File | Import XML), I highlight text within a tag, say like in your example above, the Providor name, and make it like I want and then create a new style. I generally name the styles as per the XML tag. Later on, that makes mapping tags to styles a little easier.


          Once I set up all the styles preliminarily, I map the tags to styles. You can do that either via the Tags palette or via the Structure Pane that will appear once the XML is imported. In both cases, it is found via the flyout menu at the top right of their respective windows.


          After mapping my styles to the tags, I select the root element in the Structure Pane (the topmost element. In your sample above it is "providors" and delete it. This removes the XML in your ID file. But the styles and tags are still present.


          Then I import the XML again and look to makes sure all the tags/elements are styled as intended. I then correct any errors/ommissions. Then...I'll delete the XML again and import the full XML file.


          I can upload what I did with your XML sample above so you can compare it to your source file if you would like. You would then see how/where I moved tags. Now, moving the tags is only "necessary" to avoid all the extra blank paragraphs. That can be accomplished by ID's search/replace, too. But I like to start out with the XML cleaned up, so I take the few minutes to do it.


          Take care, Mike