copyCourseUc.xsl 864 Bytes
Newer Older
Ivan D'halluin's avatar
Ivan D'halluin committed
1 2 3 4 5 6 7 8 9 10 11
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
  xmlns:h="http://www.utc.fr/ics/hdoc/xhtml"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
  xmlns:op="utc.fr:ics/opale3"
  xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
  >
  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

  <!-- The ID of the courseUc element that needs to be copied has to be passed here -->
12
  <xsl:param name="elementid"/>
Ivan D'halluin's avatar
Ivan D'halluin committed
13 14 15 16 17 18 19 20

  <xsl:template match="sc:item">
    <xsl:apply-templates select=".//sp:courseUc"/>
  </xsl:template>

  <xsl:template match="sp:courseUc[@data-export-id = $elementid]">
    <sc:item>
      <!-- Once we are in the right courseUc, we can just copy everything -->
21
      <xsl:copy-of select="./*"/>
Ivan D'halluin's avatar
Ivan D'halluin committed
22 23 24 25
    </sc:item>
  </xsl:template>

  <xsl:template match="*"/>
26
</xsl:stylesheet>