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
1cfcc4ec
Commit
1cfcc4ec
authored
Dec 15, 2016
by
Tyrannas
Browse files
fixing xsl
parent
d13c0f34
Changes
2
Hide whitespace changes
Inline
Side-by-side
hdoc_to_neo4j/ant/build.xml
deleted
100644 → 0
View file @
d13c0f34
<?xml version="1.0" encoding="UTF-8"?>
<project
name=
"antModule"
default=
"main"
basedir=
"../"
>
<property
name=
"m"
value=
"default"
></property>
<target
name=
"main"
depends=
"preparation"
>
<echo>
On transforme le fichier!!
</echo>
<xslt
basedir=
"./input"
destdir=
"./output"
extension=
".cql"
style=
"./xsl/hdoc_to_neo4j.xslt"
></xslt>
</target>
<target
name=
"preparation"
>
<echo>
On initialise le dossier!
</echo>
<delete
dir=
"./output"
></delete>
<mkdir
dir=
"./output"
></mkdir>
</target>
</project>
\ No newline at end of file
hdoc_to_neo4j/xsl/hdoc_to_neo4j.xsl
View file @
1cfcc4ec
...
...
@@ -13,18 +13,33 @@
<xsl:template
match=
"head"
/>
<xsl:template
match=
"body"
>
<xsl:template
match=
"body"
>
MERGE (i:module {title:"
<xsl:value-of
select=
"concat(../head/title,' (',string-length(.), ')')"
/>
"});
<xsl:apply-templates
select=
"./section"
/>
</xsl:template>
<xsl:template
match=
"body/section"
>
MERGE (i:Item {title:"
<xsl:value-of
select=
"./header/h1"
/>
"});
MERGE (i:item {title:"
<xsl:value-of
select=
"concat(./header/h1,' (',string-length(.), ')')"
/>
"});
MATCH (l1:item {title:"
<xsl:value-of
select=
"concat(./header/h1,' (',string-length(.), ')')"
/>
"}), (l2:module {title:"
<xsl:value-of
select=
"concat(ancestor::html/head/title,' (',string-length(ancestor::html/body), ')')"
/>
"}) MERGE (l2)-[:LIEN]->(l1);
<xsl:apply-templates
select=
"./section"
/>
</xsl:template>
<xsl:template
match=
"body/section/section"
>
MERGE (i:
I
tem {title:"
<xsl:value-of
select=
"./header/h1"
/>
"});
MATCH (l1:
I
tem {title:"
<xsl:value-of
select=
"./header/h1"
/>
"}), (l2:
I
tem {title:"
<xsl:value-of
select=
"parent::section/header/h1
"
/>
"})
CREATE (l1)-[:LIEN]->(l2);
MERGE (i:
i
tem {title:"
<xsl:value-of
select=
"
concat(
./header/h1
,' (',string-length(.), ')')
"
/>
"});
MATCH (l1:
i
tem {title:"
<xsl:value-of
select=
"
concat(
./header/h1
,' (',string-length(.), ')')
"
/>
"}), (l2:
i
tem {title:"
<xsl:value-of
select=
"
concat(
parent::section/header/h1
,' (',string-length(parent::section), ')')"
/>
"}) MERGE (l2)-[:LIEN]->(l1);
<!--<xsl:apply-templates select="./div"/>-->
</xsl:template>
<!--
<xsl:template match="body/section[@data-hdoc-type]">
MERGE (i:<xsl:value-of select="./@data-hdoc-type"/> {title:"<xsl:value-of select="./header/h1"/>"});
<xsl:apply-templates select="./section"/>
</xsl:template>
<xsl:template match="body/section[not(@data-hdoc-type)]">
MERGE (i:item {title:"<xsl:value-of select="./header/h1"/>"});
<xsl:apply-templates select="./section"/>
</xsl:template>
-->
</xsl:stylesheet>
\ No newline at end of file
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