Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Exporting to XML

From: InDesign CS4 Beyond the Basics

Video: Exporting to XML

I have opened ChocolateSheet5 from the Exercise Files, and this is a clean document, not the template we were working on in earlier movies. You can see that in the Tags panel, we don't have any tags in here, there is no tags applied to objects in the document at all. So we have been given the task of exporting this content as XML. Now, I do want to be clear that in general I recommend having InDesign be a container for receiving XML rather than a source of exporting XML. It's cleaner to start with your XML outside of InDesign and then drop it into an InDesign template as we saw in the last few movies, but if you do need to get your content out of a document here is what you can do.

Exporting to XML

I have opened ChocolateSheet5 from the Exercise Files, and this is a clean document, not the template we were working on in earlier movies. You can see that in the Tags panel, we don't have any tags in here, there is no tags applied to objects in the document at all. So we have been given the task of exporting this content as XML. Now, I do want to be clear that in general I recommend having InDesign be a container for receiving XML rather than a source of exporting XML. It's cleaner to start with your XML outside of InDesign and then drop it into an InDesign template as we saw in the last few movies, but if you do need to get your content out of a document here is what you can do.

The first thing we need is tags. I could make them one at a time, as we saw in an earlier movie, but I am just going to import them using Load Tags. I am going to just select this XML file that I have inside of the Exercise Files that has all of the tags in it. Now I am going to tag these objects in my document, just like I did in earlier movies. I will select this head at the top and I will click on Header. I will select the story here and click on story. I will click the subhead here, and I believe this is called caption. There we go. That's supposed to get the caption tag. Now let's get those images: Number 1 and Number 2.

Let's view the structure in the Structure Pane by pressing Cmd+Opt+1 or Ctrl+Alt+1 on Windows, and I will twirl down this little triangle here to see the structure here. Now, I do remember that in the XML file I want, in the structure that I want, I want to put the caption between the two images; I just remembered that, so I better just drag that down to put it in the right order. Now, inside this story, this text frame or this text thread that I tagged with the story tag, we have multiple paragraphs. In fact, if I zoom in here with Cmd+2 or Ctrl+2 on Windows, we can see that not only do we have multiple paragraph styles, we also have character styles in here as well. But all I did was apply the story tag to the whole thing.

Well, in order to tag the paragraph and the character styles in here properly I need to map those character styles and paragraph styles to proper tags in the XML. The way I am going to do that is to go to the Tags panel flyout menu, and choose Map Styles to Tags. That's different than what we saw before, before we mapped tags to styles, now we are mapping styles to tags. Now, in this case I am only going to be mapping the tags for these paragraph and the character styles, and I happen to know that that is the Body Paragraphs style, and I am going to map that to bodytext tag in the XML. Also, the Italic character style should map to emphasis.

When I click OK, you can see -- well, it's a little hard to see, but there's little yellow tags around the italic text here, and that yellow is the emphasis tag has been applied. Over in the Structure panel I can see that I have some extra twirly triangles here, and if I click on those, I can see all of the different paragraphs that had been affected here. They have all been tagged and if I look inside this bodytext paragraph, there is the emphasis tag. Another way to see the structure of this story is to look at it in Story Editor. So while this is selected on the Document Page, I am going to go to Edit and choose Edit in Story Editor. Story Editor is a wonderful way to look at tagged text, because it's much easier to see things like, that's emphasis text, than it is to look for these little tiny brackets on the page here.

We can also apply tags here. For example, I will just select these four words here and click on the emphasis tag, and you can see that it shows up here, and it shows up as tagged down here. What's more, if we look at our Structure Pane, we see that we have one more emphasis tag in the structure as well. Okay, now that we have everything tagged, let's go ahead and export the XML. I am going to export the entire document here as XML by choosing Export XML from the Structure panel menu. Another way to do this would be to choose Export from the File menu and just do the normal export dialog box route; both do exactly the same thing.

We will name it here; tell it where to save the XML file. Click Save, and we will see the Export XML dialog box. I am not going to go through all of these options right now, because they get kind of technical, but I will tell you the ones that are most important. First of all, we are going to view the XML after its exported using whatever application you want to use. I have a text editor on the Mac here called TextWrangler. This is my favorite text editor on the Mac, its a free text editor, and it works really well for viewing text, so that's what I have chosen here. But if you have another application that handles XML or text, you can choose it from this pop-up menu.

We are going to be Exporting From the Selected Element here. Because we have selected Root, so we are just going to grab the entire thing. If we had Tables then we might want to export them as CALS XML, but I am not going to worry about that now, I have no tables in here. Now, Remap Break, Whitespace, and Special Characters is important in my experience, because InDesign seems to put in a lot of weird characters in the XML, and sometimes that can really mess up a text editor or an XML Editor, so I recommend that you always Remap those Break, Whitespace, and Special Characters to other characters in the XML, it's just safer that way.

In an earlier movie I was talking about XSLT and how it's like a supercharged Find/Change feature. If you have an XSLT that you want to use, you can Apply it here upon export, and all of your XML will be pushed through that Find/Changer thing and it will turn into something different, whatever the XSLT tells it to do. XSLTs are quite powerful. You can turn almost anything into anything else. For example, I have seen XSLTs that will take regular XML and convert it into HTML, so that would be an option here for your XML.

I also want to point out, there is an Images tab of the Export XML dialog box, and this gives you control over how you want your images to be exported. Typically, you just get an XML file, just the text file, but if I turn on any of these checkboxes then I actually get the images themselves inside an Images Subfolder; it will copy them into an Images Subfolder for me. That could be useful in certain circumstances. The Original Images, it's obvious it just copies the entire original image: the Photoshop files, or TIFFs or JPEGs or whatever. But Optimized Original Image will actually convert those images into JPEGs and GIFs for me.

I have to tell you, I am not a fan of this. I personally feel like Photoshop would be a better tool, or Fireworks, or almost anything else would be a better tool than InDesign for converting images into GIFs or JPEGs, so I don't use that. But I will point out that if you are going to do it, you might want to use this Optimized Formatted Images option instead, because that will actually crop and scale and rotate and whatever. It will format those images and then convert them to JPEGs or GIFs on the fly. So in this case, I don't want any of those images, I just wanted to let you know that that was an option.

I am going to click Export, and it will export the XML and open it up in the text editor, in this case TextWrangler. If you squint here you can really see that all of the data is there: the headers and the story and the emphasis information, and so on and so on, it's all there, including the graphics and the images at the end, and so on. Now, just because I have exported XML successfully from InDesign doesn't mean that I can turn around and reimport it back into InDesign. That's called round tripping. While it is possible to round-trip your XML in some situations, I have to tell you that in most cases it won't work right without some significant massaging. In fact, in general, you should probably expect to do some cleanup of InDesign's XML files, whether this is headed to the web or to a database or back into some other InDesign template.

Nevertheless, the ability to get XML out of InDesign can be incredibly useful, especially in a fast-paced production environment, where you need to repurpose your content everyday.

Show transcript

This video is part of

Image for InDesign CS4 Beyond the Basics
InDesign CS4 Beyond the Basics

90 video lessons · 24657 viewers

David Blatner
Author

 
Expand all | Collapse all
  1. 2m 11s
    1. Welcome
      1m 3s
    2. Using the exercise files
      1m 8s
  2. 25m 16s
    1. Reviewing Control panel shortcuts
      8m 34s
    2. Managing panels
      6m 14s
    3. Letting InDesign do the math
      2m 52s
    4. Using Selection tool clicks
      1m 39s
    5. Using Quick Apply shortcuts
      3m 2s
    6. Setting up context shortcuts
      2m 55s
  3. 23m 51s
    1. Using column guides
      3m 42s
    2. Formatting and positioning guides
      5m 15s
    3. Setting first baseline options
      5m 30s
    4. Using the Document grid
      3m 13s
    5. Setting bleeds
      3m 3s
    6. Using slugs
      3m 8s
  4. 48m 2s
    1. Shuffling pages (or not)
      2m 47s
    2. Scaling objects to a specific size
      2m 32s
    3. Aligning objects to a page
      4m 41s
    4. Using advanced libraries
      4m 5s
    5. Using advanced anchored objects
      11m 21s
    6. Setting non-printing objects
      3m 10s
    7. Creating notes
      5m 23s
    8. Using Data Merge
      10m 41s
    9. Creating templates
      3m 22s
  5. 39m 32s
    1. Creating polygons and starbursts
      2m 35s
    2. Setting custom stroke styles
      5m 15s
    3. Using advanced effects
      8m 46s
    4. Making masks in InDesign
      4m 10s
    5. Integrating InDesign and Illustrator
      4m 59s
    6. Setting compound paths
      5m 4s
    7. Using advanced clipping paths
      6m 6s
    8. Using advanced image transparency
      2m 37s
  6. 55m 26s
    1. Using advanced text formatting
      5m 37s
    2. Using other languages
      4m 22s
    3. Setting advanced paragraph numbering
      3m 12s
    4. Using GREP to find/change
      6m 54s
    5. Managing glyphs
      5m 6s
    6. Finding and changing glyphs
      2m 39s
    7. Adding footnotes
      7m 57s
    8. Creating outlines
      3m 39s
    9. Setting conditional text
      9m 16s
    10. Creating cross-references
      6m 44s
  7. 33m 3s
    1. Advanced text importing
      7m 49s
    2. Using Apply Next Style
      5m 4s
    3. Advanced text styling
      6m 9s
    4. Setting load styles
      2m 58s
    5. Linking to text files on disk
      4m 1s
    6. Understanding GREP styles
      7m 2s
  8. 1h 4m
    1. Building a multi-document book
      4m 42s
    2. Setting page numbering across books
      7m 53s
    3. Setting chapter numbering
      6m 7s
    4. Using the Section Marker feature
      6m 53s
    5. Creating "Continued On..." numbers
      4m 44s
    6. Synchronizing documents in a book
      5m 41s
    7. Creating a table of contents
      11m 24s
    8. Indexing documents
      7m 24s
    9. Generating an index
      6m 47s
    10. Printing or exporting a book
      3m 10s
  9. 46m 4s
    1. Creating hyperlinks
      12m 53s
    2. Setting bookmarks
      6m 7s
    3. Creating buttons
      11m 16s
    4. Making movies
      8m 24s
    5. Creating sounds
      4m 51s
    6. Setting page transitions
      2m 33s
  10. 25m 59s
    1. Setting up swatch and style defaults
      3m 24s
    2. Using mixed ink colors
      6m 16s
    3. Working with duotones
      4m 23s
    4. Overprinting
      2m 10s
    5. Ink aliasing
      4m 50s
    6. Using the Kuler panel
      4m 56s
  11. 50m 27s
    1. Creating the transparency blend space
      4m 6s
    2. Understanding InDesign color settings
      9m 8s
    3. Assign Profile and Convert to Profile
      3m 26s
    4. Working with RGB images
      7m 54s
    5. Working with CMYK images
      6m 28s
    6. Soft-proofing
      5m 18s
    7. Managing color at print time
      7m 25s
    8. Managing color in a PDF export
      6m 42s
  12. 42m 1s
    1. Embedding preflight profiles
      5m 1s
    2. Using the Transparency Flattener preview
      3m 23s
    3. Reviewing Transparency Flattener settings
      6m 30s
    4. Setting print presets
      3m 35s
    5. Setting PDF presets
      3m 21s
    6. Exporting to XHTML
      7m 42s
    7. Exporting to SWF
      6m 45s
    8. Exporting to XFL
      5m 44s
  13. 25m 58s
    1. Understanding XML and InDesign
      6m 51s
    2. Structuring InDesign content
      4m 17s
    3. Importing XML
      6m 57s
    4. Exporting to XML
      7m 53s
  14. 34s
    1. Goodbye
      34s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed InDesign CS4 Beyond the Basics.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.