Commit 1cfcc4ec authored by Tyrannas's avatar Tyrannas

fixing xsl

parent 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
......@@ -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:Item {title:"<xsl:value-of select="./header/h1"/>"});
MATCH (l1:Item {title:"<xsl:value-of select="./header/h1"/>"}), (l2:Item {title:"<xsl:value-of select="parent::section/header/h1"/>"})
CREATE (l1)-[:LIEN]->(l2);
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:item {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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment