Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
XML is all the rage among publishers these days and it seems like everyone wants to move into an XML workflow. But what is XML? Why would you want to use it? XML is all about separating content from the form of that content. So where something like HTML is all about telling a web browser what the text and graphics should look like, XML says I don't care what it looks like. Let me just tell you what it is. Now that's important because these days we don't know where our content is going to end up. It could be a newspaper one day and a cell phone the next. If you are doing one little ad for the local grocer, you may never need to worry about XML.
But if you are creating that ad every week, and the content is changing and you have to produce in four different sizes, well then XML maybe the answer to your dreams. I will be showing you a quick overview of how XML works in InDesign in this movie and then I will be going into more depth in the later movies in this chapter. But before I start, there are four things I need to tell you about XML. First of all, XML is a huge topic, there is just so much that could be said about it. So I am only going to be covering a quick version of it. This is sort of just an introduction to XML in InDesign. If you need more information about XML, definitely check out the XML Essential Training here at the lynda.com Online Training Library. Also, Olav Kvern and I wrote a book called Real World InDesign CS4 and you can get much more information about XML in that book.
There is another book that you should definitely check out if you want to know more about XML. It's called A Designer's Guide to InDesign and XML, by Jim Maivald with Cathy Palmer and that book has lots of information about XML and InDesign along with lots of good exercises for learning XML. So those are good resources to look for after you get this basic introduction to XML. The second thing I want to tell you is that XML is so complex that it really takes a village. You want to get a team of people working together including XML consultants and trainers, everybody working together in order to make an XML workflow work for you. There are a lot of companies that just say, oh, we are going to start doing XML, we will just make it work. Hey Joe, you do XML and it doesn't work that way. You got to get everybody on board in order for an XML workflow to work. It's very complex.
The third thing you need to know is that XML requires a nearly obsessive attention to details. You have to find that person in the office; every office has one person who is just like a style-fascist. Someone who just winces whenever you use local formatting and you want to find that person and make them in-charge of XML. You got to find the person who just loves paragraph styles and character styles and that's the perfect person for XML, because if you are not like that, you are going to really get yourself in trouble with XML. You got to be careful with every aspect of your templates and your styles and everything.
Finally and I can't emphasize this enough, XML is all about structure. You have to find the structure inside of your documents. A lot of people make InDesign documents all over the place, there is no structure at all, just like an illustration. That's not for XML. XML is really for structured documents and then I am not talking about only large 4,000 page technical documents, even one or two page documents as we will see in a minute can have structure. But you need to identify that structure or else there is no way that you will use XML for it.
All right, I want to show you XML in action here in InDesign. I have a basic template. I have got some graphic frames and some text frames. I want to put some headers up here and all kinds of information through here. I also have some aspects of this template that are going to be the same on every page, the logo, this Nutrition Facts and so on, and I would like to populate this with information. But that information is currently living in an XML file. Let me show you. This is the XML file and I don't want to get into the details of how XML is written and what applications you should use and so on, but I just want to point out that XML is just text, plain old text. For example, you can see the text for the header right here, Chocolate Ganache. That is inside some XML tag that's called Header.
I have some other paragraphs in here inside tags called bodytext, images down here that I am going to be importing, a caption that I am going to be importing and so on, and all of that data needs to go into a template in exactly the right place with exactly the right styling. So I will switch back to InDesign and in order to import this, I need to show something called the Structure pane. So I will go to View > Structure > Show Structure and I am going to click on the Root of this. I am going to get into the details of this in later movies in this chapter. For right now, I will just follow along and I will show you how it works. I am going to choose Root, go to File and choose Import XML and I am going to pick that XML file that I was just looking at.
Now I will click Open and it will give me all kinds of XML Import Options. I don't want to get into the details of all of these right now, but I am going to turn on a few of these checkboxes and then I will just click OK. In one second, all of that data gets imported and placed in the template. Everything is styled and it's ready to go. I love that. But part of the power of XML is not just that you can format one of these, it's that you can format a lot of them. So let's go and grab that Root element again. Go back to File, choose Import XML and I am going to pick a different XML file. It's structured exactly the same way, but has different data in it and because there is different data, when I click Open and then click OK, I get all that new data in the same template. It literally threw away the old stuff and put the new stuff in, in exactly the right place.
Now if the whole point of XML is to separate content and form, then I should be able to take the same content and put it into a different form, right? Well, we can do that. Let's go open the ChocolateSheet2 document from the Exercise Files and I am going to put the same content into a completely different form. This is a 640 x 480 thing that I am going to be exporting up to SWF or a PDF or I don't know something, but I want to drop that same data into here. So I will choose Root, I will go to Import XML, grab one of these, it doesn't matter which and I will click Open, let's go ahead and turn these on, click OK and the same data came in here but in a completely different format. In fact, some of the data didn't come in at all. You don't have to use all the data in an XML file when you are importing it.
So in this case, I left out this longer story and just took the heading, the image and the subhead and I dropped it in here. Again, this all works because we have content that is completely separated from its form. So now we could take that same content and flow it into a web page or a page suitable for a cell phone or insert it into a database. In the next few movies, I am going to be deconstructing these files showing how you can assign tags in your documents, import XML and even export your InDesign content to XML.
Get unlimited access to all courses for just $25/month.Become a member
120 Video lessons · 58279 Viewers
119 Video lessons · 67563 Viewers
84 Video lessons · 16854 Viewers
125 Video lessons · 29751 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.