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
72a55462
Commit
72a55462
authored
Jan 03, 2016
by
Drain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Opale2Optim] Improved ressources management
parent
42f770d3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
6 deletions
+76
-6
opale_to_hdoc/opale_to_hdoc.ant
opale_to_hdoc/opale_to_hdoc.ant
+16
-2
opale_to_hdoc/xsl/find_ressources.xsl
opale_to_hdoc/xsl/find_ressources.xsl
+29
-0
opale_to_hdoc/xsl/opale_to_hdoc_regle1.xsl
opale_to_hdoc/xsl/opale_to_hdoc_regle1.xsl
+7
-1
opale_to_hdoc/xsl/opale_to_hdoc_regle2.xsl
opale_to_hdoc/xsl/opale_to_hdoc_regle2.xsl
+24
-3
No files found.
opale_to_hdoc/opale_to_hdoc.ant
View file @
72a55462
...
...
@@ -19,6 +19,7 @@
<antcall target="check_source_xml" />
<antcall target="hdoc_structure" />
<antcall target="fusion_xml" />
<antcall target="copy_ressources"/>
<antcall target="content_xml" />
<antcall target="zip" />
<antcall target="clean" />
...
...
@@ -30,6 +31,7 @@
<delete dir="${UnzipSourcePath}"/>
<delete dir="${TmpPath}"/>
<delete dir="${HdocPath}"/>
<delete file="get_ressources.ant"></delete>
</target>
<!-- Check if only one xml file -->
...
...
@@ -88,14 +90,26 @@
<pathconvert property="xml.path" pathsep="" refid="fileset_source_xml" />
<!-- xsl -->
<xslt style="xsl/opale_to_hdoc_regle1.xsl" in="${xml.path}" out="./${TmpPath}/${TmpFile1}">
<xslt style="xsl/opale_to_hdoc_regle1.xsl" in="${xml.path}" out="./${TmpPath}/${TmpFile1}" classpath="./lib/saxon9he.jar">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
</target>
<!-- Copy ressources -->
<target name="copy_ressources">
<xslt style="xsl/find_ressources.xsl" in="./${TmpPath}/${TmpFile1}" out="./get_ressources.ant" classpath="./lib/saxon9he.jar" >
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<chmod file="get_ressources.ant" perm="777"/>
<ant antfile="get_ressources.ant"/>
</target>
<!-- Create content.xml -->
<target name="content_xml">
<xslt style="xsl/opale_to_hdoc_regle2.xsl" in="./${TmpPath}/${TmpFile1}" out="./${HdocPath}/${RacineFile}" />
<xslt style="xsl/opale_to_hdoc_regle2.xsl" in="./${TmpPath}/${TmpFile1}" out="./${HdocPath}/${RacineFile}" classpath="./lib/saxon9he.jar">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
</target>
<!-- Zip Hdoc -->
...
...
opale_to_hdoc/xsl/find_ressources.xsl
0 → 100644
View file @
72a55462
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes=
"xs"
version=
"2.0"
xmlns:sc=
"http://www.utc.fr/ics/scenari/v3/core"
xmlns:sp=
"http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:op=
"utc.fr:ics/opale3"
>
<xsl:variable
name=
"ProjectFileName"
select=
"opale_to_hdoc"
/>
<xsl:template
match=
"sc:item"
>
<project
name=
'Opale2Hdoc'
default=
"main"
>
<target
name=
'main'
>
<xsl:apply-templates
select=
"//sp:res[@sc:refUri]"
/>
</target>
</project>
</xsl:template>
<xsl:template
match=
"sp:res[@sc:refUri]"
>
<xsl:variable
name=
"link"
select=
"@sc:refUri"
></xsl:variable>
<xsl:variable
name=
"name"
select=
"tokenize($link, '/')[last()]"
></xsl:variable>
<xsl:variable
name=
"link2"
select=
"substring-after($link, concat($ProjectFileName, '/'))"
></xsl:variable>
<copy
file=
"{$link2}/{$name}"
todir=
"output/hdoc/re"
/>
</xsl:template>
<xsl:template
match=
"*"
></xsl:template>
</xsl:stylesheet>
\ No newline at end of file
opale_to_hdoc/xsl/opale_to_hdoc_regle1.xsl
View file @
72a55462
...
...
@@ -5,7 +5,7 @@
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes=
"xs"
version=
"2.0"
xmlns:sc=
"http://www.utc.fr/ics/scenari/v3/core"
xmlns:sp=
"http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:op=
"utc.fr:ics/opale3"
>
...
...
@@ -28,6 +28,12 @@
</xsl:copy>
</xsl:template>
<xsl:template
match=
"sp:res[@sc:refUri]"
>
<sp:res
sc:refUri=
"{resolve-uri(@sc:refUri, document-uri(/))}"
>
<xsl:apply-templates/>
</sp:res>
</xsl:template>
<!-- si j'ai un node de type attribut appelé sc:refUri -->
<!--<xsl:template match="*[@sc:refUri]"> -->
<!-- ne pas recopier l'élement ? -->
...
...
opale_to_hdoc/xsl/opale_to_hdoc_regle2.xsl
View file @
72a55462
...
...
@@ -223,6 +223,21 @@
<!-- ***** BLOCS START ***** -->
<xsl:template
match=
"sp:res[op:resInfoM/sp:index/text() = 'img']"
>
<xsl:variable
name=
"name"
select=
"tokenize(@sc:refUri, '/')[last()]"
></xsl:variable>
<img
src=
"re/{$name}"
alt=
"{$name}"
/>
</xsl:template>
<xsl:template
match=
"sp:res[op:resInfoM/sp:index/text() = 'graph']"
>
<xsl:variable
name=
"name"
select=
"tokenize(@sc:refUri, '/')[last()]"
></xsl:variable>
<object
data=
"re/{$name}"
type=
"application/vnd.oasis.opendocument.graphics"
/>
</xsl:template>
<xsl:template
match=
"sp:res[op:resInfoM/sp:index/text() = 'tab']"
>
<xsl:variable
name=
"name"
select=
"tokenize(@sc:refUri, '/')[last()]"
></xsl:variable>
<object
data=
"re/{$name}"
type=
"application/vnd.oasis.opendocument.spreadsheet"
/>
</xsl:template>
<!-- content Information : no microformat -->
<xsl:template
match=
"sp:pb/op:pb/sp:info"
>
<div>
...
...
@@ -358,11 +373,9 @@
<xsl:value-of
select=
"."
/>
</span>
</xsl:template>
<!-- email or url -->
<xsl:template
match=
"sc:para/sc:uLink"
priority=
"2"
>
<a
href=
"{./@url}"
>
<xsl:value-of
select=
"."
/>
</a>
</xsl:template>
<!-- exponent -->
<xsl:template
match=
"sc:para/sc:textLeaf[@role='exp']"
priority=
"2"
>
...
...
@@ -387,6 +400,14 @@
<xsl:value-of
select=
"."
/>
</xsl:template>
<xsl:template
match=
"sc:para/sc:phrase[@role='url']"
>
<xsl:apply-templates
select=
"op:urlM/sp:url"
/>
</xsl:template>
<xsl:template
match=
"op:urlM/sp:url"
>
<a
href=
"{text()}"
><xsl:value-of
select=
"text()"
></xsl:value-of></a>
</xsl:template>
<!-- ***** PARAGRAPH ITEMS END ***** -->
<!-- List-->
...
...
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