
Using the XML Viewer Web Part
❘
301
<displayQuestion type=”choice”>Which platform is SharePoint
built on?</displayQuestion>
<answers>
<answer>PhP</answer>
<answer>ColdFusion</answer>
<answer>ASP.NET</answer>
<answer>J2EE</answer>
</answers>
</question>
<question>
<questionID>2</questionID>
<displayQuestion type=”choice”>What assets do SharePoint branders
typically modify?</displayQuestion>
<answers>
<answer>CSS Rules</answer>
<answer>Master Pages</answer>
<answer>Page Layouts</answer>
<answer>Images</answer>
<answer>All of the above</answer>
</answers>
</question>
</quiz>
Notice that you will be starting with the basic XML data without a reference to an XSL fi le.
The Web Part will create the relationship for you, so it wouldn’t make sense to add one here.
5. Click the XML Editor button on the tool pane shown in Figure 10-14. This will present the
Text Editor dialog. Simply paste in the XML data and click OK to close the editor.
Now, for the XSL data, you will use the fi nal XSL style sheet from the previous section,
which is also available for download:
<xsl:stylesheet version=”1.0” xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”>
<xsl:template match=”/”>
<html>
<body>
<h1>Easiest SharePoint Quiz Ever!</h1>
<ol>
<xsl:for-each select=”quiz/question”>
<li>
<strong>
<xsl:value-of select=”displayQuestion”/>
</strong>
<br/>
<xsl:for-each select=”answers/answer”>
<span style=”font-style: ...