XML Developer Tip
(Receive this column in your inbox,
click Edit your Profile to subscribe.)
Recently, in the process of resolving a misunderstanding with one of my publishers, I was struck once again that the real power of XML lies in its ability to deliver well-structured data in nearly arbitrary form with a minimum of muss and fuss. Please let me explain: Those who read my tips know that (a) my company and I create a lot of IT certification preparation materials, and (b) that we have an XML- and Java-based test engine that we can use to capture and deliver exam questions, practice exams, surveys, and so forth related to such topics.
I found out on Thursday from a publisher that they were expecting us to write questions for their test engine, not ours. Alas, I had already instructed the question authors over 6 weeks prior to write for our test engine, and their work was due in a few short days. It was way too late to say "Sorry, guys. You'll have to recast your materials in a different format." And in fact, thanks to the expressive power and flexibility of XML, we really didn't need to stress about it too much.
Once I was able to ascertain that indeed the publisher wanted questions in their engine's format, not ours, the next issue then became "what does a question look like in their engine's format?" A brief discussion with one of their in-house engine gurus, and a quick review of the format details, showed us that 95% of the material mapped directly from our engine to theirs (or theirs to ours, had we been going the other way). That makes it entirely feasible to create an XSLT transform to take our markup and recast it as a plain ASCII file that uses their proprietary tags (not XML, but syntactically straightforward enough to make mechanical translation entirely feasible).
Since the exams in question will accompany a book, the missing 5% of the content for their engine is information that ties individual questions to specific chapters and questions in the book. As we use XSLT to transform what's translatable, we're also inserting an easy to find string (such as &+&+ or something similar that doesn't occur naturally either in our XML markup or in their proprietary engine codes) so we can insert empty tags where the missing data is supposed to be. The only human effort that will be involved in switching from our format to theirs will involve using the Find command in a text editor, looking up the chapter and section references where relevant topics are covered, and providing that information for each such missing content marker.
The total time involved in writing the XSLT was about 2 hours, testing took another hour. We expect adding the missing content to take about 6-8 hours, and since we had planned to submit our materials two weeks early, we'll end up turning them in 12 days early instead. No big deal, no major panic, not even a terrible amount of extra work. And it's all thanks to XML. Maybe we got lucky, but to my way of thinking the luck was in the decision to use XML in the first place since it has made this and other transformations of our question data easy and straightforward ever since.
About the Author
Ed Tittel is a principal at LANWrights, Inc., a network-oriented writing, training, and consulting firm based in Austin, Texas. He is the creator of the Exam Cram series and has worked on over 30 certification-related books on Microsoft, Novell, and Sun related topics. Ed teaches in the Certified Webmaster Program at Austin Community College and consults. He a member of the NetWorld + Interop faculty, where he specializes in Windows 2000 related courses and presentations.
For More Information:
- Looking for free research? Browse our comprehensive White Papers section by topic, author or keyword.
- Are you tired of technospeak? The Web Services Advisor column uses plain talk without the hype.
- For insightful opinion and commentary from today's industry leaders, read our Guest Commentary columns.
- Hey Codeheads! Start benefiting from other time-saving XML Developer Tips and .NET Developer Tips.
- Visit our huge Best Web Links for Web Services collection for the freshest editor-selected resources.
- Choking on the alphabet soup of industry acronyms? Visit our helpful Glossary for the latest lingo.
- Visit Ask the Experts for answers to your Web services, SOAP, WSDL, XML, .NET, Java and EAI questions.
- Discuss this issue, voice your opinion or just talk with your peers in the SearchWebServices Discussion Forums.