Top Ten XML Myths

XML is a scary thing. We all know it’s around us—in our web­sites, in our soft­ware, prob­a­bly in our cere­al and in our city water too. Perhaps it’s the ubiq­ui­ty of XML com­bined with its unknown qual­i­ties that makes it seem a tough tech­nol­o­gy to mas­ter, but my recent XML Workflow tuto­r­i­al with Jim Maivald and Cooking With XML real­ly helped me under­stand XML, what it does and does­n’t do, and its uses for today’s design­er. If you’re a design­er for print or the web, read the fol­low­ing ten XML myths and re-learn what you have learned.

10. XML is a spe­cial lan­guage requir­ing spe­cial edi­tors. Some peo­ple may think XML requires expen­sive soft­ware or even web design soft­ware like Dreamweaver to cre­ate. Guess what? It’s total­ly com­posed of plain text and TextEdit or Notepad will write XML just as eas­i­ly as XMLSpy, a lead­ing XML editor.

9. XML is only for the web. I took this tuto­r­i­al at the InDesign Conference, so that’s your first clue that XML does more than just web­sites. XML is data, so you can think of it as a tab- or comma-delimited file, able to be import­ed into any appli­ca­tion that can under­stand it and dis­play it.

8. XML does things to data. As men­tioned above, XML is data and that’s all it is. Without soft­ware like InDesign to parse the data or some­thing like an XSLT file to inter­pret it and style it, XML is just a bunch of text.

Note: XSLT allows XML to be trans­formed and dis­played by style sheets, thus creait­ng a method for dis­play­ing XML data as styled text and visu­al ele­ments. It’s one of the most pop­u­lar ways to pub­lish XML on websites.

7. It’s too easy to get bad XML data pub­lished. The beau­ty of XML is that a pars­er or inter­preter (like XSLT) requires valid XML to process it prop­er­ly. There are a lot of rules with XML that must be obeyed, but in the end it’s a boon for XML authors because that means either the XML is valid, and every­thing shows up cor­rect­ly, or the XML is invalid and the appli­ca­tion will let you know. Print design­ers: think of XML as data’s PDF/X‑1a. Creating a PDF/X‑1a out of a doc­u­ment with RGB images does­n’t gen­er­ate a PDF, but an error. The process makes sure you fix every­thing before you can move on. XML val­i­dates in exact­ly the same way.

6. XML is hard to write. There are some dif­fi­cult things to remem­ber as far as syn­tax goes, espe­cial­ly for XSLT, but XML itself is actu­al­ly straight­for­ward. The log­ic of XML is so sim­ple that prac­ti­cal­ly any­one can write it, and as with HTML there are sev­er­al options for writ­ing XML with­out hav­ing to type a line of code. Exporting data­bas­es as XML is a great way to do just that.

5. XML is a new kind of lan­guage. XML and HTML are actu­al­ly based on the same lan­guage, SGML from the 1970s. Look at the struc­ture of XML and HTML code side by side, and you’ll see they are close­ly relat­ed. If you can write HTML, you are actu­al­ly more than qual­i­fied to write XML after learn­ing a few things about syn­tax and rules.

4. XML has­n’t pen­e­trat­ed the main­stream design appli­ca­tion mar­ket yet. Wrong! Not only is XML being used by some of the biggest design appli­ca­tions out there, some (like Dreamweaver 8) are made of the stuff! At the con­fer­ence I got to know the Tags palette in InDesign, which is not used to cre­ate HTML but to work with import­ed XML in order to pub­lish an infi­nite num­ber of data-driven doc­u­ments in only a few steps. Many oth­er appli­ca­tions out there can lever­age XML in the same way.

Not only are design appli­ca­tions work­ing with XML, most major web browsers includ­ing Internet Explorer are XML-compatible.

3. Displaying XML data is tough. With tech­nol­o­gy like Cascading Style Sheets and the pars­ing abil­i­ties of appli­ca­tions like InDesign, bring­ing XML from pure data to styled data is eas­i­er and eas­i­er. It’s still the last and hard­est step before hav­ing a fin­ished data-driven doc­u­ment or prod­uct, but once you get the hang of it it’s actu­al­ly pret­ty easy.

2. XML has too many rules. If you write HTML, you know that every tag does some­thing dif­fer­ent.