XPathAndXSLT_4001

Last modified by superadmin on 2018-01-12 20:24

Back to Item Set

<p/>
<!-- START TestItem -->
<p/>
<div class="TestItem">
<div class="TestItemQuestion">4001 Question:\

{code:xml}
<?xml version="1.0"?>
<library>
  <author name="William Shakespeare">
    <book>
      <title>Macbeth</title>
      <pages>236</pages>
    </book>
    <book>
      <title>Romeo and Juliet</title>
      <pages>209</pages>
    </book>
    <book>
      <title>Othello</title>
      <pages>311</pages>
    </book>
  </author>
</library>
{code} Using the above XML document, you are assigned to create a stylesheet that lists the title of each of the Shakespeare books in the library's inventory. Which one of the following XSL samples do you use in the stylesheet to produce this list in HTML? 

</div>

Select 1 correct answer(s)!

<p/>
<ol class="MTestItemChoices" type='A'>
<li>

{code:xml}
<xsl:value-of select="/library/author/book/title>
  <br/>
</xsl:value-of>
{code}

</li>
<li>

{code:xml}
<xsl:for-each select="/library/author/book/title">
  <xsl:value-of select="."/><br/>
</xsl:for-each>
{code}

</li>
<li>

{code:xml}
<xsl:for-each select="/library/author/book/title">
  <br/>
</xsl:for-each>
{code}

</li>
<li>

{code:xml}
<xsl:for-each>
  <xsl:value-of select="/library/author/book/title"/><br/>
</xsl:for-each>
{code}

</li>
<li>

{code:xml}
<xsl:while test="/library/author/book/title[. = '']">
  <xsl:value-of select="/library/author/book/title"/><br/>
</xsl:while>
{code}

</li>
</ol>
<p/>
<div class="TestItemSkill"><!--$skillid>Skill: XSLT 1.0 Constructs</div>
<p/>
</div>
<!-- END MTestItem -->
<p/>
<p/>


{{/velocity}}

Tags:
Created by Kalvis Apsītis on 2008-01-01 21:20
    
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 6.4 - Documentation