Commit e661b1a3 authored by Charlotte Luszcz's avatar Charlotte Luszcz

Updated hdoc_to_canoprof schema, added manangement of syntax, method, information and legal blocks

parent 0047b7c3
...@@ -8,11 +8,9 @@ ...@@ -8,11 +8,9 @@
<a:documentation>This schema is a restriction of XHTML (it validates XHTML <a:documentation>This schema is a restriction of XHTML (it validates XHTML
schema, if namespace is changed to http://www.w3.org/1999/xhtml)</a:documentation> schema, if namespace is changed to http://www.w3.org/1999/xhtml)</a:documentation>
<a:documentation>Last update : 2014-12-04</a:documentation> <a:documentation>Last update : 2014-12-22</a:documentation>
<a:documentation>Changes since last update : <a:documentation>Changes since last update :
Adding object type -> application/pdf Adding biblio management via a href='' data-hdoc-type='bibtexml'
Adding introduction and conclusion to section header and footer
Externalizing ObjectType and VideoType (to type.rng)
</a:documentation> </a:documentation>
<start> <start>
...@@ -196,6 +194,13 @@ ...@@ -196,6 +194,13 @@
</element> </element>
</optional> </optional>
<ref name="Flow"/> <ref name="Flow"/>
<optional>
<element name="div">
<ref name="DivType"/>
<ref name="Text"/>
</element>
</optional>
</element> </element>
</oneOrMore> </oneOrMore>
</define> </define>
......
...@@ -22,7 +22,16 @@ ...@@ -22,7 +22,16 @@
<value>conclusion</value> <value>conclusion</value>
<value>unit-of-content</value> <value>unit-of-content</value>
<value>multiple-choice-question</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>
<value>order</value>
<value>match</value>
<value>group</value>
</choice> </choice>
</attribute> </attribute>
</optional> </optional>
...@@ -40,11 +49,24 @@ ...@@ -40,11 +49,24 @@
<value>remark</value> <value>remark</value>
<value>warning</value> <value>warning</value>
<value>advice</value> <value>advice</value>
<value>remind</value>
<value>method</value>
<value>information</value>
<!-- quiz management --> <!-- quiz management -->
<value>question</value> <value>question</value>
<value>singlechoicequestion</value>
<value>choice</value>
<value>solution</value>
<value>choice-correct</value> <value>choice-correct</value>
<value>choice-incorrect</value> <value>choice-incorrect</value>
<value>explanation</value> <value>explanation</value>
<value>explanation-choice-correct</value>
<value>explanation-choice-incorrect</value>
<value>openQuestion</value>
<value>hint</value>
<value>gapText</value>
<value>label</value>
<value>target</value>
</choice> </choice>
</attribute> </attribute>
</optional> </optional>
...@@ -57,7 +79,7 @@ ...@@ -57,7 +79,7 @@
<value>syntax</value> <value>syntax</value>
<value>latex</value> <value>latex</value>
<!-- quiz management --> <!-- quiz management -->
<value>blank</value> <value>blank</value>
</choice> </choice>
</attribute> </attribute>
</optional> </optional>
...@@ -68,7 +90,8 @@ ...@@ -68,7 +90,8 @@
<choice> <choice>
<value>application/vnd.oasis.opendocument.graphics </value> <value>application/vnd.oasis.opendocument.graphics </value>
<value>application/vnd.oasis.opendocument.spreadsheet</value> <value>application/vnd.oasis.opendocument.spreadsheet</value>
<value>application/pdf</value> <value>application/pdf</value>
<value>application/x-listing</value>
</choice> </choice>
</attribute> </attribute>
</define> </define>
......
...@@ -347,6 +347,44 @@ ...@@ -347,6 +347,44 @@
</cp:block> </cp:block>
</sp:method> </sp:method>
</xsl:when> </xsl:when>
<!-- hdoc's information = canoprof's info -->
<xsl:when test="./@data-hdoc-type = 'information'">
<sp:info>
<cp:block>
<cp:blockM>
<xsl:if test="string-length(./h:h6/text()) > 0">
<sp:title>
<xsl:value-of select="./h:h6"/>
</sp:title>
</xsl:if>
</cp:blockM>
<sp:body>
<cp:flow>
<xsl:apply-templates select="./*"/>
</cp:flow>
</sp:body>
</cp:block>
</sp:info>
</xsl:when>
<!-- hdoc's method = canoprof's method -->
<xsl:when test="./@data-hdoc-type = 'method'">
<sp:method>
<cp:block>
<cp:blockM>
<xsl:if test="string-length(./h:h6/text()) > 0">
<sp:title>
<xsl:value-of select="./h:h6"/>
</sp:title>
</xsl:if>
</cp:blockM>
<sp:body>
<cp:flow>
<xsl:apply-templates select="./*"/>
</cp:flow>
</sp:body>
</cp:block>
</sp:method>
</xsl:when>
<!-- hdoc's autres or no attribute = canoprof's information--> <!-- hdoc's autres or no attribute = canoprof's information-->
<xsl:otherwise> <xsl:otherwise>
<sp:info> <sp:info>
......
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
<object data="re/{$name}" type="application/vnd.oasis.opendocument.spreadsheet"/> <object data="re/{$name}" type="application/vnd.oasis.opendocument.spreadsheet"/>
</xsl:template> </xsl:template>
<!-- content Information : no microformat --> <!-- content Information : information -->
<xsl:template match="sp:pb/op:pb/sp:info"> <xsl:template match="sp:pb/op:pb/sp:info">
<div data-hdoc-type="information"> <div data-hdoc-type="information">
<xsl:apply-templates select="./op:pbTi/sp:title"/> <xsl:apply-templates select="./op:pbTi/sp:title"/>
...@@ -378,20 +378,20 @@ ...@@ -378,20 +378,20 @@
</xsl:template> </xsl:template>
<!-- content syntax : complement --> <!-- content syntax : complement -->
<xsl:template match="sp:pb/op:pb/sp:syntax"> <xsl:template match="sp:pb/op:pb/sp:syntax">
<div data-hdoc-type="information"> <div data-hdoc-type="complement">
<xsl:apply-templates select="./op:pbTi/sp:title"/> <xsl:apply-templates select="./op:pbTi/sp:title"/>
<xsl:apply-templates select="op:res/*"/> <xsl:apply-templates select="op:res/*"/>
</div> </div>
</xsl:template> </xsl:template>
<!-- content legal : complement --> <!-- content legal : complement -->
<xsl:template match="sp:pb/op:pb/sp:legal"> <xsl:template match="sp:pb/op:pb/sp:legal">
<div data-hdoc-type="information"> <div data-hdoc-type="complement">
<xsl:apply-templates select="./op:pbTi/sp:title"/> <xsl:apply-templates select="./op:pbTi/sp:title"/>
<xsl:apply-templates select="op:res/*"/> <xsl:apply-templates select="op:res/*"/>
</div> </div>
</xsl:template> </xsl:template>
<!-- content simulation : no microformat (we lose this information) --> <!-- content simulation : no microformat-->
<xsl:template match="sp:pb/op:pb/sp:simul"> <xsl:template match="sp:pb/op:pb/sp:simul">
<div> <div>
<xsl:apply-templates select="./op:pbTi/sp:title"/> <xsl:apply-templates select="./op:pbTi/sp:title"/>
......
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