<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                

<xsl:output method="xml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional// EN" indent="yes"/> 


<xsl:template name="strip-HTML">
    <xsl:param name="text"/>
	
	<xsl:choose>
		<xsl:when test="starts-with($text, '&lt;p')">
			<p></p>
		</xsl:when>
	</xsl:choose>
	
	
	
	
	
					
    <xsl:choose>
        <xsl:when test="contains($text, '&gt;')">
            <xsl:choose>
                <xsl:when test="contains($text, '&lt;')">
                    <xsl:value-of select="concat(substring-before($text, '&lt;'), ' ')"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="substring-before($text, '&gt;')"/>
                </xsl:otherwise>
            </xsl:choose>
            <xsl:call-template name="strip-HTML">
                <xsl:with-param name="text" select="substring-after($text,
'&gt;')"/>
            </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
            <xsl:value-of select="$text"/>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>





<xsl:template match="interactions/interaction/parameters/cparameter">

	
 	<html xmlns="http://www.w3.org/1999/xhtml">
   	<head>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	
     	<title>
		eBook
     	</title>
   	</head>
   	<body>
   	
   	

<xsl:for-each select="optionpage"> 

	
	
	<xsl:for-each select="entrydata"> 

	<xsl:if test="input/@optionStore='Title'"> 
		    
		    <xsl:if test="(string(input))">
 		    
			<xsl:variable name="humanReadableID" select="(string(input))" />
			
			<xsl:variable name="machineReadableID" select="translate($humanReadableID, ' ', '_')" />
			
			 <div style="page-break-before:always" align="center" id="{$machineReadableID}"><b><xsl:value-of select="input"/></b></div>
			
			
			</xsl:if>
		    

         </xsl:if> 

	


	<xsl:if test="input/@type='JetOptionHTMLEditor'"> 

				<p>
                
                <xsl:if test="(string(input))">    
					
					
		
			

			
				
				<xsl:choose>
			
			     
			
				<xsl:when test="contains(input, '&gt;')">
            

					<xsl:call-template name="strip-HTML">
                				<xsl:with-param name="text" select="input"/>
					</xsl:call-template>

	  	 		</xsl:when>

	    		</xsl:choose>
				
			
				
				
				
            
				 	
			
		</xsl:if>
		    	     </p>

        </xsl:if> 

	
	<xsl:if test="input/@type='JetOptionImageArea'"> 
		
		
			<xsl:if test="(string(input))">
			<div style="page-break-before:always" />
				
			<xsl:variable name="image" select="(string(input))" />
			
			
			<xsl:choose>
				
				<xsl:when test="contains($image, '.jpg')" >
					
					
					<img src="images/{$image}"></img>
					
				</xsl:when>
				
				<xsl:when test="contains($image, '.swf')" >		
					
					
					<object data="images/{$image}" WIDTH="400" HEIGHT="300" />
					
				</xsl:when>
				
				
				
				
				
			</xsl:choose>
			
			
					    	
		    </xsl:if>
			
		    
		    <xsl:if test="(string(imageCaption))">
			
			<p/>  <font size="10pt">
                    	<xsl:value-of select="imageCaption"/>
				  </font>
                    	<br/>
					    	
		    </xsl:if>
			
			
		    <xsl:if test="(string(imageSource))">
						
						<font size="10pt">
                    	<xsl:value-of select="imageSource"/>
						</font>
                    	<br/>
						
						<div style="page-break-after:always" />
						
						
		    	
		    </xsl:if>

               </xsl:if> 
               
       <xsl:if test="input/@optionStore='TextArea_2'"> 
		    
		    <xsl:if test="(string(input))">
 		    <br/>
		    
		    Question: <xsl:value-of select="input"/>
		    

		    </xsl:if>
		    

         </xsl:if> 


	</xsl:for-each> 

</xsl:for-each> 





 </body>
 </html>

</xsl:template>
</xsl:stylesheet>


