Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
hdoc
Commits
0b31fbd1
Commit
0b31fbd1
authored
Dec 16, 2015
by
Bastien FREMONDIERE
Browse files
Update the_witcher.mm + Fix link + Done intro and conclu
parent
1f7ea5e7
Changes
2
Show whitespace changes
Inline
Side-by-side
mindmapping_to_hdoc/samples/the_witcher.mm
View file @
0b31fbd1
<
map
version
=
"1.0.1"
>
<!-
-
To
view
this
file
,
download
free
mind
mapping
software
FreeMind
from
http
:
//freemind.sourceforge.net -->
<
node
CREATED
=
"1449485059502"
ID
=
"ID_1970904157"
MODIFIED
=
"1449733283013"
>
<
node
CREATED
=
"1449486713098"
ID
=
"ID_983701334"
MODIFIED
=
"1449486715515"
TEXT
=
"#intro Une introduction"
/>
<
node
CREATED
=
"1449486720318"
ID
=
"ID_737906523"
MODIFIED
=
"1449486722975"
TEXT
=
"#conclu Une conclusion"
/>
<
richcontent
TYPE
=
"NODE"
><
html
>
<
head
>
...
...
@@ -36,8 +38,6 @@
</
node
>
<
node
CREATED
=
"1449485926526"
ID
=
"ID_289476678"
MODIFIED
=
"1449486753624"
POSITION
=
"left"
TEXT
=
"Scénario"
>
<
node
CREATED
=
"1449485946398"
ID
=
"ID_596698657"
MODIFIED
=
"1449734206316"
TEXT
=
"#p Mon personnage bien aîmé attaque tous les monstres alentours pour de l'argent"
/>
<
node
CREATED
=
"1449486713098"
ID
=
"ID_983701334"
MODIFIED
=
"1449486715515"
TEXT
=
"#intro"
/>
<
node
CREATED
=
"1449486720318"
ID
=
"ID_737906523"
MODIFIED
=
"1449486722975"
TEXT
=
"#conclu"
/>
<
node
CREATED
=
"1449486747017"
ID
=
"ID_1777634105"
MODIFIED
=
"1449486750554"
TEXT
=
"#mcq"
/>
</
node
>
</
node
>
...
...
mindmapping_to_hdoc/xslt/sect.xsl
View file @
0b31fbd1
...
...
@@ -5,8 +5,10 @@
<!-- This is wrong -> xpath-default-namespace="http://www.utc.fr/ics/hdoc/xhtml"-->
<xsl:output
method=
"xml"
indent=
"yes"
/>
<!-- Remove spaces/tabs -->
<xsl:strip-space
elements=
"*"
/>
<!-- Entry point -->
<xsl:template
match=
"map"
>
<xsl:processing-instruction
name=
"oxygen"
>
RNGSchema="http://scenari.utc.fr/hdoc/schemas/xhtml/hdoc1-xhtml.rng" type="xml"
...
...
@@ -22,7 +24,7 @@
</xsl:template>
<!-- Header in hdoc -->
<xsl:template
match=
"node[1]"
mode=
"header"
>
<title>
<xsl:value-of
select=
"@TEXT"
/>
...
...
@@ -41,7 +43,26 @@
<xsl:value-of
select=
"richcontent"
/>
</h1>
</header>
<!--Introduction-->
<xsl:if
test=
"child::*[contains(@TEXT, '#intro')]"
>
<xsl:element
name=
"section"
>
<xsl:attribute
name=
"data-hdoc-type"
>
introduction
</xsl:attribute>
<xsl:value-of
select=
"utc:string-remove-all(child::*[contains(@TEXT, '#intro')][1]/@TEXT, '#intro ')"
/>
</xsl:element>
</xsl:if>
<!-- Process children -->
<xsl:apply-templates
select=
"node"
/>
<!--Conclusion-->
<xsl:if
test=
"child::*[contains(@TEXT, '#conclu')]"
>
<xsl:element
name=
"section"
>
<xsl:attribute
name=
"data-hdoc-type"
>
conclusion
</xsl:attribute>
<xsl:value-of
select=
"utc:string-remove-all(child::*[contains(@TEXT, '#conclu')][1]/@TEXT, '#conclu ')"
/>
</xsl:element>
</xsl:if>
</xsl:element>
</xsl:template>
...
...
@@ -56,6 +77,11 @@
</xd:doc>
<xsl:element
name=
"section"
>
<xsl:attribute
name=
"data-hdoc-type"
>
unit-of-content
</xsl:attribute>
<xsl:if
test=
"child::attribute[@NAME='anchor']"
>
<xsl:attribute
name=
"id"
>
<xsl:value-of
select=
"child::attribute[@NAME='anchor'][1]/@VALUE"
></xsl:value-of>
</xsl:attribute>
</xsl:if>
<header>
<h1>
<xsl:value-of
select=
"@TEXT"
/>
...
...
@@ -66,12 +92,14 @@
</xsl:element>
</xsl:template>
<!-- Paragraph -->
<xsl:template
match=
"node[contains(@TEXT, '#p')]"
priority=
"2"
>
<xsl:element
name=
"p"
>
<xsl:value-of
select=
"utc:string-remove-all(@TEXT, '#p ')"
/>
</xsl:element>
</xsl:template>
<!-- Link : need to use anchor attribute ? -->
<xsl:template
match=
"node[contains(@TEXT, '#a')]"
priority=
"2"
>
<xsl:element
name=
"a"
>
<xsl:attribute
name=
"href"
>
...
...
@@ -82,12 +110,14 @@
</xsl:element>
</xsl:template>
<!-- Default behavior for intro and conclu nodes : do nothing -->
<xsl:template
match=
"node[contains(@TEXT, '#intro')] | node[contains(@TEXT, '#conclu')]"
priority=
"3"
/>
<xsl:template
match=
"richcontent"
>
<xsl:value-of
select=
"html/body/p"
/>
</xsl:template>
<!-- Utility functions -->
<xsl:function
name=
"utc:string-remove-all"
as=
"xs:string"
>
<xsl:param
name=
"text"
as=
"xs:string"
/>
<xsl:param
name=
"replace"
as=
"xs:string"
/>
...
...
@@ -97,7 +127,7 @@
<xsl:with-param
name=
"replace"
select=
"$replace"
/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of
select=
"$ret"
></xsl:value-of
>
<xsl:value-of
select=
"$ret"
/
>
</xsl:function>
<xsl:template
name=
"string-remove-all"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment