Skip to content
GitLab
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
d94792fb
Commit
d94792fb
authored
Dec 14, 2015
by
Zangdar1111
Browse files
ajout ordonanncement fonctionnel
parent
92ab1272
Changes
1
Hide whitespace changes
Inline
Side-by-side
mindmapping_to_hdoc/xslt/sect.xsl
View file @
d94792fb
...
...
@@ -37,11 +37,14 @@
<xsl:element
name=
"section"
>
<header>
<h1>
<xsl:value-of
select=
"@TEXT"
/>
<xsl:value-of
select=
"utc:string-remove-order('#1 test')"
></xsl:value-of>
<xsl:value-of
select=
"utc:string-remove-order(@TEXT)"
/>
<xsl:value-of
select=
"richcontent"
/>
</h1>
</header>
<xsl:apply-templates
select=
"node"
/>
<xsl:apply-templates
select=
"./node"
>
<xsl:sort
select=
"string(999-number(substring-after(tokenize(@TEXT,' ')[matches(.,'#([1-9][0-9]*)')],'#')))"
order=
"descending"
data-type=
"number"
stable=
"yes"
></xsl:sort>
</xsl:apply-templates>
</xsl:element>
</xsl:template>
...
...
@@ -49,16 +52,11 @@
<xsl:template
match=
"node[not(node)]|node[child::*[contains(@TEXT, '#p')]]|node[child::*[contains(@TEXT, '#a')]]"
priority=
"1"
>
<xd:doc
xmlns:xd=
"http://www.oxygenxml.com/ns/doc/xsl"
>
<xd:desc>
<xd:p/>
</xd:desc>
</xd:doc>
<xsl:element
name=
"section"
>
<xsl:attribute
name=
"data-hdoc-type"
>
unit-of-content
</xsl:attribute>
<header>
<h1>
<xsl:value-of
select=
"@TEXT"
/>
<xsl:value-of
select=
"
utc:string-remove-order(
@TEXT
)
"
/>
<xsl:value-of
select=
"richcontent"
/>
</h1>
</header>
...
...
@@ -68,7 +66,7 @@
<xsl:template
match=
"node[contains(@TEXT, '#p')]"
priority=
"2"
>
<xsl:element
name=
"p"
>
<xsl:value-of
select=
"utc:string-remove-all(@TEXT, '#p ')"
/>
<xsl:value-of
select=
"utc:string-remove-
order(utc:string-remove-
all(@TEXT, '#p ')
)
"
/>
</xsl:element>
</xsl:template>
...
...
@@ -76,9 +74,9 @@
<xsl:element
name=
"a"
>
<xsl:attribute
name=
"href"
>
<xsl:text>
#
</xsl:text>
<xsl:value-of
select=
"utc:string-remove-all(@TEXT, '#a ')"
/>
<xsl:value-of
select=
"utc:string-remove-
order(utc:string-remove-
all(@TEXT, '#a ')
)
"
/>
</xsl:attribute>
<xsl:value-of
select=
"utc:string-remove-all(@TEXT, '#a ')"
/>
<xsl:value-of
select=
"utc:string-remove-
order(utc:string-remove-
all(@TEXT, '#a ')
)
"
/>
</xsl:element>
</xsl:template>
...
...
@@ -116,4 +114,11 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:function
name=
"utc:string-remove-order"
as=
"xs:string"
>
<xsl:param
name=
"text"
as=
"xs:string?"
/>
<xsl:variable
name=
"text2"
select=
"string($text)"
/>
<xsl:value-of
select=
"replace($text2,'#[1-9][0-9]* ','')"
></xsl:value-of>
</xsl:function>
</xsl:stylesheet>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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