Commit 0cda743d authored by Esquilax76's avatar Esquilax76

gestion types de noeuds

parent d6283b42
......@@ -19,27 +19,15 @@
</xsl:template>
<xsl:template match="body/section">
MERGE (i:item {title:"<xsl:value-of select="concat(./header/h1,' (',string-length(.), ')')"/>"});
MATCH (l1:item {title:"<xsl:value-of select="concat(./header/h1,' (',string-length(.), ')')"/>"}), (l2:module {title:"<xsl:value-of select="concat(ancestor::html/head/title,' (',string-length(ancestor::html/body), ')')"/>"}) MERGE (l2)-[:LIEN]->(l1);
MERGE (i:<xsl:value-of select="./@data-hdoc-type"/> {title:"<xsl:value-of select="concat(./header/h1,' (',string-length(.), ')')"/>"});
MATCH (l1 {title:"<xsl:value-of select="concat(./header/h1,' (',string-length(.), ')')"/>"}), (l2 {title:"<xsl:value-of select="concat(ancestor::html/head/title,' (',string-length(ancestor::html/body), ')')"/>"}) MERGE (l2)-[:LIEN]->(l1);
<xsl:apply-templates select="./section"/>
</xsl:template>
<xsl:template match="body/section/section">
MERGE (i:item {title:"<xsl:value-of select="concat(./header/h1,' (',string-length(.), ')')"/>"});
MATCH (l1:item {title:"<xsl:value-of select="concat(./header/h1,' (',string-length(.), ')')"/>"}), (l2:item {title:"<xsl:value-of select="concat(parent::section/header/h1,' (',string-length(parent::section), ')')"/>"}) MERGE (l2)-[:LIEN]->(l1);
MERGE (i:<xsl:value-of select="./@data-hdoc-type"/> {title:"<xsl:value-of select="concat(./header/h1,' (',string-length(.), ')')"/>"});
MATCH (l1 {title:"<xsl:value-of select="concat(./header/h1,' (',string-length(.), ')')"/>"}), (l2 {title:"<xsl:value-of select="concat(parent::section/header/h1,' (',string-length(parent::section), ')')"/>"}) MERGE (l2)-[:LIEN]->(l1);
<!--<xsl:apply-templates select="./div"/>-->
</xsl:template>
<!--
<xsl:template match="body/section[@data-hdoc-type]">
MERGE (i:<xsl:value-of select="./@data-hdoc-type"/> {title:"<xsl:value-of select="./header/h1"/>"});
<xsl:apply-templates select="./section"/>
</xsl:template>
<xsl:template match="body/section[not(@data-hdoc-type)]">
MERGE (i:item {title:"<xsl:value-of select="./header/h1"/>"});
<xsl:apply-templates select="./section"/>
</xsl:template>
-->
</xsl:stylesheet>
\ No newline at end of file
......@@ -12,7 +12,7 @@
<!-- cas d'une activité d'apprentissage (avec contenu externe) -->
<xsl:template match="sp:courseUa[@sc:refUri]">
<!-- se copie soit même -->
<!-- se copie soi même -->
<xsl:copy>
<!-- à faire : copier seulement ce qui est dans la balise sc:item du fichier distant -->
<xsl:apply-templates select="document(./@sc:refUri)/sc:item/*"/>
......@@ -21,7 +21,7 @@
<!-- cas d'un grain de contenu (avec contenu externe) -->
<xsl:template match="sp:courseUc[@sc:refUri]">
<!-- se copie soit même -->
<!-- se copie soi même -->
<xsl:copy>
<!-- avec comme contenu ce qui se trouve dans la balise sc:item du fichier distant -->
<xsl:apply-templates select="document(./@sc:refUri)/sc:item/*"/>
......@@ -30,14 +30,22 @@
<!-- cas d'une division (avec contenu externe) -->
<xsl:template match="op:ue/sp:div[@sc:refUri] | op:ueDiv/sp:div[@sc:refUri]">
<!-- se copie soit même -->
<!-- se copie soi même -->
<xsl:copy>
<!-- avec comme contenu ce qui se trouve dans la balise sc:item du fichier distant -->
<xsl:apply-templates select="document(./@sc:refUri)/sc:item/*"/>
</xsl:copy>
</xsl:template>
<!-- cas d'un exercice rédactionnel (avec contenu externe) -->
<xsl:template match="sp:practUc[@sc:refUri]">
<!-- se copie soi même -->
<xsl:copy>
<!-- avec comme contenu ce qui se trouve dans la balise sc:item du fichier distant -->
<xsl:apply-templates select="document(./@sc:refUri)/sc:item/*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="sp:res[@sc:refUri]">
<sp:res sc:refUri="{resolve-uri(@sc:refUri, document-uri(/))}">
<xsl:apply-templates/>
......
......@@ -44,7 +44,7 @@
</xsl:template>
<!-- Titles -->
<xsl:template match="op:uM/sp:title | op:expUcDivM/sp:title | op:ueDivM/sp:title">
<xsl:template match="op:uM/sp:title | op:expUcDivM/sp:title | op:ueDivM/sp:title | op:exeM/sp:title">
<h1>
<xsl:value-of select="."/>
</h1>
......@@ -104,7 +104,7 @@
<!-- Division -->
<xsl:template match="op:ue/sp:div | op:ueDiv/sp:div">
<section>
<section data-hdoc-type="division">
<header>
<xsl:apply-templates select="./op:ueDiv/op:ueDivM/sp:title"/>
<xsl:apply-templates
......@@ -115,10 +115,12 @@
<!-- check for sub-division -->
<xsl:apply-templates select="./op:ueDiv/sp:div"/>
<!-- currently : grain & introduction & conclusion -->
<!-- currently : grain & introduction & conclusion || adding "exercice redactionnel" || adding "actvite d'apprentissage" -->
<xsl:apply-templates select="./op:ueDiv/sp:intro"/>
<xsl:apply-templates select="./op:ueDiv/sp:courseUc"/>
<xsl:apply-templates select="./op:ueDiv/sp:conclu"/>
<xsl:apply-templates select="./op:ueDiv/sp:practUc"/>
<xsl:apply-templates select="./op:ueDiv/sp:courseUa"/>
<footer>
<xsl:apply-templates select="./op:ueDiv/op:ueDivM/sp:info/op:info/sp:keywds"/>
......@@ -128,7 +130,7 @@
<!-- Activity -->
<xsl:template match="sp:courseUa">
<section>
<section data-hdoc-type="activity">
<header>
<xsl:apply-templates select="./op:courseUa/op:uM/sp:title"/>
<xsl:apply-templates
......@@ -144,7 +146,7 @@
<!-- overview questions : regroup questions into a section-->
<xsl:if test="./op:courseUa/sp:quest">
<section>
<section data-hdoc-type="synthesis">
<header>
<h1>Questions de synthèse</h1>
</header>
......@@ -163,7 +165,7 @@
<!-- Grain -->
<xsl:template match="sp:courseUc">
<section>
<section data-hdoc-type="grain">
<header>
<xsl:apply-templates select="./op:expUc/op:uM/sp:title"/>
<xsl:apply-templates
......@@ -185,7 +187,7 @@
<!-- Aims (aims don't have metadata) -->
<xsl:template match="sp:obj">
<section>
<section data-hdoc-type="aims">
<header>
<h1>Objectifs</h1>
</header>
......@@ -234,7 +236,7 @@
<!-- Parts (of a Grain) -->
<xsl:template match="op:expUc/sp:div | op:expUcDiv/sp:div">
<section>
<section data-hdoc-type="part">
<header>
<!-- only title - parts don't have other metadata -->
<xsl:apply-templates select="./op:expUcDiv/op:expUcDivM/sp:title"/>
......@@ -248,6 +250,16 @@
</section>
</xsl:template>
<!-- "Exercice redactionnel" -->
<xsl:template match="sp:practUc">
<section data-hdoc-type="exercise">
<header>
<xsl:apply-templates select="op:practUc/op:exeM/sp:title"/>
</header>
</section>
</xsl:template>
<!-- ***** BLOCS START ***** -->
......
......@@ -22,7 +22,13 @@
<value>conclusion</value>
<value>unit-of-content</value>
<value>multiple-choice-question</value>
<value>fill-in-the-blank</value>
<value>fill-in-the-blank</value>
<value>division</value>
<value>grain</value>
<value>exercise</value>
<value>activity</value>
<value>aims</value>
<value>synthesis</value>
</choice>
</attribute>
</optional>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment