﻿<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0"
    xmlns:sl="http://schemas.microsoft.com/client/2007"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    exclude-result-prefixes="sl">

  <xsl:output omit-xml-declaration="yes" indent="yes"/>

  <xsl:template match="/">
    <xsl:comment>This is the text that is in the Silverlight XAML:</xsl:comment>
    <xsl:apply-templates select="*"/>
  </xsl:template>

  <xsl:template match="sl:Canvas">
    <div>
      <xsl:apply-templates select="*"/>
    </div>
  </xsl:template>

  <xsl:template match="node()"/>

  <xsl:template match="sl:Image">
    <div>
      <img src="{@Source}"/>
    </div>
  </xsl:template>
  <xsl:template match="sl:MediaElement">
    <div class="Media">
      <a href="{@Source}">Media</a>
    </div>
  </xsl:template>

  <xsl:template match="sl:TextBlock">
    <div>
      <xsl:value-of select="@Text"/>
      <xsl:value-of select="text()"/>
      <xsl:apply-templates select="*"/>
    </div>
  </xsl:template>
  <xsl:template match="sl:LineBreak">
    <br/>
  </xsl:template>

  <xsl:template match="sl:Run">
    <span>
      <xsl:value-of select="@Text"/>
      <xsl:value-of select="text()"/>
    </span>
  </xsl:template>
</xsl:stylesheet>

