Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hdoc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Stephane Crozat
hdoc
Commits
e75f910e
Commit
e75f910e
authored
Jan 02, 2016
by
Hachem Rihab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[hdoc_to_optim] outsource optim chapters
parent
2c0b581d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
4 deletions
+46
-4
hdoc_to_optim/hdoc_to_optim.ant
hdoc_to_optim/hdoc_to_optim.ant
+1
-1
hdoc_to_optim/xsl/transfo.xsl
hdoc_to_optim/xsl/transfo.xsl
+45
-3
No files found.
hdoc_to_optim/hdoc_to_optim.ant
View file @
e75f910e
...
...
@@ -26,7 +26,7 @@
<!--launches the ANT get_content resulting from the previous XSLT in order to launch the conversion-->
<ant antfile="get_content.ant"/>
<!--once the conversion is complete, the result is zipped-->
<zip basedir="result" destfile="${OutputScarPath}"/>
<zip basedir="result" destfile="${OutputScarPath}"
encoding="UTF-8"
/>
<!--temporary files and folders are deleted-->
<delete dir="hdoc"/>
...
...
hdoc_to_optim/xsl/transfo.xsl
View file @
e75f910e
...
...
@@ -13,7 +13,7 @@
</of:paper>
</sc:item>
</xsl:template>
<xsl:strip-space
elements=
"*"
/>
<!--Metadata of the head tag-->
<xsl:template
match=
"h:head"
>
<of:paperM>
...
...
@@ -88,8 +88,23 @@
<!--hdoc sections can become chapters or sections in Optim, we must differentiate the two-->
<xsl:template
match=
"h:body/h:section"
>
<sp:chap>
<xsl:call-template
name=
"sec-body"
/>
<xsl:variable
name=
"chapi"
select=
"(.//text())[1]"
/>
<xsl:message><xsl:value-of
select=
"$chapi"
/></xsl:message>
<xsl:variable
name=
"chap"
>
<xsl:choose>
<xsl:when
test=
"contains($chapi,':')"
>
<xsl:message>
Yescontiiii!
</xsl:message>
<xsl:value-of
select=
"normalize-space(replace($chapi,':','-'))"
/>
</xsl:when>
<xsl:otherwise><xsl:value-of
select=
"normalize-space($chapi)"
/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:message><xsl:value-of
select=
"$chap"
/></xsl:message>
<xsl:message>
test
</xsl:message>
<sp:chap
sc:refUri=
"{$chap}.section"
>
<xsl:call-template
name=
"sec-body1"
>
<xsl:with-param
name=
"chap"
select =
"$chap"
/>
</xsl:call-template>
</sp:chap>
</xsl:template>
...
...
@@ -98,6 +113,33 @@
<xsl:call-template
name=
"sec-body"
/>
</sp:sec>
</xsl:template>
<xsl:template
name=
"sec-body1"
>
<xsl:param
name =
"chap"
/>
<xsl:message><xsl:value-of
select=
"$chap"
/></xsl:message>
<xsl:result-document
encoding=
"UTF-8"
href=
"{$chap}.section"
>
<sc:item
xmlns:sc=
"http://www.utc.fr/ics/scenari/v3/core"
>
<of:section>
<xsl:if
test=
"@data-hdoc-type='introduction'"
>
<xsl:comment>
Introduction
</xsl:comment>
</xsl:if>
<xsl:if
test=
"@data-hdoc-type='conclusion'"
>
<xsl:comment>
Conclusion
</xsl:comment>
</xsl:if>
<xsl:apply-templates
select=
"h:header"
/>
<xsl:if
test=
"./h:div"
>
<sp:content>
<of:fragment>
<xsl:apply-templates
select=
"h:div"
/>
</of:fragment>
</sp:content>
</xsl:if>
<xsl:apply-templates
select=
"h:section"
/>
</of:section>
</sc:item>
</xsl:result-document>
<xsl:apply-templates
select=
"h:footer"
/>
</xsl:template>
<xsl:template
name=
"sec-body"
>
<of:section>
...
...
Write
Preview
Markdown
is supported
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