Skip to main content
Shop Support Downloads
IBM Home Products Consulting Industries News About IBM
IBM developerWorks : XML : Education - Tutorials
Tootomatic with Java 2 v1.4.2_05, and a Self-test feature
PDF (letter)PDF (A4)Javascript e-mail it pop-up
Main menuSection menuFeedbackPreviousNext
4. Self-Test Feature

Adding Self-Test Elements page 2 of 3

to your tutorial's xml file, ADD the following to the desired panel:

<self-test span="0" question="?" choice1=" " answer1=" " choice2=" " answer2=" " choice3=" " answer3=" " choice4=" " answer4=" " />
<noscript>Javascript must me enabled to see the self-test example</noscript>

The Self-Test feature's answers can be seen by viewing the page's source.

This feature is written by Javascript. If the page is viewed with a browser that does not have Javascript enabled, it will not be visible, the noscript text will be. The tutorial's PDF files will aslo show the noscript text.

Spans are numbered beginning with Zero. If the Self-Test is added to a page that has span tags prior to it's location, the attribute's number should be changed accordingly. Subsequent self-test elements on the same panel would likewise be incremented.

Use Entities with care. Any tags entered into the attribute values need the "left angle" to be entered as &lt; and quotes need to be either &amp;#39; for single or &amp;#34; for double.

For example, the next panel has:

<self-test span="0" question="How many Files need to be changed?&lt;br />A: the tootomatic.xsl file.&lt;br />B: the dw-style.xsl file.&lt;br />C: the build-individual-panels.xsl file&lt;br />D: the dwtut.dtd and tootomatic.xsd files." choice1="only A" answer1="If you don&amp;#39;t mind creating a zip file or having a non-functional image-link" choice2="A and B" answer2="That fixes the zip file problems but leaves a non-functional feedback form" choice3="C and D" answer3="Pragmatically, the dtd and xsd files don&amp;#39;t need to be changed. And you still have the Zip file problem." choice4="All of them" answer4=" Correct, if you&amp;#39;re a perfectionist." />
<noscript>What files need to be changed to eliminate thrown exceptions?</noscript>

Avoid the "white-space" problems involved with copying the above code and Cut and Paste from the zipped Text files. The code for the self-test element for the tutorial's xml file is included in the File Modifications folder

Main menuSection menuFeedbackPreviousNext
About IBM | Privacy | Legal | Contact