Monday, November 22, 2010

Success and Conclusion

Finally, finally, I feel like I’m making progress. Go figure, it comes at the end of my project, but I’ll take it where I can get it! After going through several chapters of the Lynda InDesign Dynamic Publishing Workflows tutorial, then looping back to the XML Essentials section on document type definitions (DTDs), I was able to put together an XML file of my own, then create associated DTD and CSS files to help translate it. Because the XML file I composed was simple, building the other two files wasn’t too complicated, once I got the hang of the different expressions for each. I took some screenshots of my accomplishments that will follow shortly, after I give the disclaimer that my web design skills—which are kind of tragic right now—are not indicative of my print design skills. I promise.

Okay, so:

Here’s the XML (with embedded DTD) file I built in oXygen:

Photobucket

And here’s the accompanying CSS file:

Photobucket

Here’s what the XML file looked like in Firefox (beautiful, I know):

Photobucket

In InDesign, I loaded the tags from my XML document, built a simple template with empty text boxes, and tagged each with a different element in the order in which I wanted them to appear. InDesign does some handy color coding so it’s easy to see which box is designated with which tag.

Photobucket

I then made sure to map my tags to some style sheets I’d created, which help determine the appearance of each different element. When I imported the XML document into my InDesign document, it populated each box with the content from my XML file and styled it according to the style sheets I’d mapped. I think I actually squealed when this worked:

Photobucket

After a quick cosmetic cleanup, I managed to have an InDesign document that looked halfway presentable:

Photobucket

Finally, I exported XML from InDesign to see how well it would translate after all these steps. Much to my great pleasure, it reproduced almost exactly as the original XML file had!

Photobucket

By the way, if you can’t read the text, it’s pasted below. I can assure you it’s completely true.

The Cats That Kept Knocking My Stuff Over
Sarah Weathers

November 2010

When the cats are hungry, the cats are likely to do stupid things. Like knock things over.

The cats are scheduled to be fed at 7:00 PM every night. You might think that after nearly two years of this, the cats would learn that begging before 7 is pointless and only gets them temporarily locked out of my bedroom. Yet here we are, and here my frustration lies. It’s not easy keeping cats from doing stupid things, especially when they’re being driven mad by hunger, but I have found a solution. To keep them from jumping from my bed, over my entertainment center (that would be my little TV and PS3 sitting on top of a bookcase propped up against the foot of my bed), and onto my dresser, I have built a wall. The wall consists of two major pieces: an ancient but suitably large Lite-Brite box and a package of unopened string lights that I hope to hang up one day (today is not that day). I hope that this makeshift barrier will keep my hungry cats from knocking more stuff over.

I’ve also included photographic proof, which, incidentally, I tried to work into my XML file but couldn’t work out for the life of me. Baby steps, I guess.

Photobucket

Given that I’ve finally had a breakthrough—as in, I understand what’s going on and can make it work for my own custom content—I think I’ll end my project here. As I’ve indicated in past posts, I plan on continuing to learn about XML, even if I don’t blog about it along the way.

Best of luck to everyone in pursuing your own XML projects!

No comments:

Post a Comment