Commit f7e264d1 authored by Jean Vintache's avatar Jean Vintache

fix merge conflicts

parents 850f45e6 112cef1e
......@@ -32,12 +32,16 @@
<target name="apply-xslt">
<htmlcleaner src="${in}/pad.html" dest="${tmp}/pad-clean.xml"/>
<xslt in="${xsl}/html2xhtml.xsl" out="${tmp}/tmpPad.xhtml" style="${xsl}/html2xhtml.xsl" />
<xslt in="${tmp}/tmpPad.xhtml" out="${tmp}/tozip/content.xml" style="${xsl}/xhtml2hdoc.xsl" />
<xslt in="${tmp}/tmpPad.xhtml" out="${tmp}/tmpPad2.xhtml" style="${xsl}/html2xhtmlv2.xsl" />
<!-- a priori la tâche suivante ne sert à rien -->
<xslt in="${tmp}/tmpPad2.xhtml" out="${tmp}/tmpPad3.xhtml" style="${xsl}/html2xhtml3.xsl" />
<xslt in="${tmp}/tmpPad3.xhtml" out="${tmp}/tozip/content.xml" style="${xsl}/xhtml2hdoc.xsl" />
</target>
<!-- Builds Hdoc structure -->
<target name="construct_hdoc">
<mkdir dir="${tmp}/tozip/" />
<mkdir dir="${tmp}/META-INF/" />
<mkdir dir="${tmp}/tozip/META-INF" />
<mkdir dir="${tmp}/META-INF" />
......
......@@ -8,7 +8,7 @@
<xsl:strip-space elements="*"/>
<xsl:param name="text-encoding" as="xs:string" select="'utf-8'"/>
<xsl:param name="text-uri" as="xs:string" select="'../tmp/pad-clean.xml'"/>
<xsl:param name="text-uri" as="xs:string" select="'../input/pad.html'"/>
<xsl:template name="text2xml">
<xsl:variable name="text" select="unparsed-text($text-uri, $text-encoding)"/>
......@@ -23,7 +23,7 @@
<body>
<div>
<p>
<xsl:value-of select="replace(normalize-space(regex-group(2)), 'br /', 'br /')" disable-output-escaping="yes"/>
<xsl:value-of select="replace(normalize-space(regex-group(2)), '&lt;br&gt;', '&lt;br/&gt;')" disable-output-escaping="yes"/>
</p>
</div>
</body>
......
<?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"
xmlns="http://www.utc.fr/ics/hdoc/xhtml" version="2.0">
<xsl:output method="xml" indent="yes"/>
<!--Identity template,
provides default behavior that copies all content into the output -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!--More specific template for Node766 that provides custom behavior -->
<xsl:template match="body">
<xsl:choose>
<xsl:when test="div/ul">
<xsl:copy>
<xsl:value-of select="ul"/>
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:key name="bits" match="p/node()[not(self::br)]" use="generate-id((..|preceding-sibling::br[1])[last()])"/>
<xsl:template match="p">
<p>
<xsl:apply-templates select="key('bits', generate-id())"/>
</p>
<xsl:apply-templates select="br"/>
</xsl:template>
<xsl:template match="p/br">
<p>
<xsl:apply-templates select="key('bits', generate-id())"/>
</p>
</xsl:template>
<xsl:template match="strong">
<em>
<xsl:apply-templates select="@*|node()"/>
</em>
</xsl:template>
<xsl:template match="s">
<em>
<xsl:apply-templates select="@*|node()"/>
</em>
</xsl:template>
<xsl:template match="u">
<em>
<xsl:apply-templates select="@*|node()"/>
</em>
</xsl:template>
<xsl:template match="page">
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
<?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"
xmlns="http://www.utc.fr/ics/hdoc/xhtml"
version="2.0">
<xsl:output method="xml" indent="yes"></xsl:output>
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
xmlns="http://www.utc.fr/ics/hdoc/xhtml" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="html">
<html>
<head>
<title><xsl:value-of select="/html/head/title"/></title>
<title>
<xsl:value-of select="/html/head/title"/>
</title>
<meta charset="utf-8"/>
</head>
<body>
......@@ -17,46 +17,57 @@
<header>
<h1>Contenu</h1>
</header>
<div>
<p><xsl:value-of select="/html/body/div"></xsl:value-of></p>
</div>
<xsl:apply-templates select="/html/body/div"/>
</section>
</body>
</html>
</xsl:template>
<xsl:template match="div/a">
<p><a href="{.}"><xsl:value-of select="text()"/></a></p>
</xsl:template>
<xsl:template match="div/ol">
<ol>
<xsl:apply-templates select="*"></xsl:apply-templates>
</ol>
</xsl:template>
<xsl:template match="li">
<li>
<xsl:choose>
<xsl:when test="count(*) = 0"> <!-- Si la liste n'a pas de mise en forme (n'a pas de balises filles) et ne contient que du texte, on récupère le texte -->
<p><xsl:value-of select="."/></p>
</xsl:when>
<xsl:otherwise> <!-- Si mise en forme, on relance les règles-->
<xsl:template match="/html/body/div" priority="1">
<xsl:choose>
<xsl:when test="p/ul">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="*"/>
</xsl:element>
</xsl:when>
<xsl:when test="p/ol">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="*"/>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<p>
<xsl:element name="{local-name()}">
<xsl:apply-templates select="node() | @*"/>
</xsl:element>
</p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="div/ul">
<ul>
<xsl:apply-templates select="*"></xsl:apply-templates>
</ul>
<!--
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="em|strong|s">
<p><em><xsl:value-of select="."/></em></p>
</xsl:template>
<xsl:template match="li/br">
<p/>
-->
<xsl:template match="/">
<xsl:apply-templates select="*"></xsl:apply-templates>
</xsl:template>
<<<<<<< HEAD
<xsl:template match="*">
<xsl:comment>Error</xsl:comment>
</xsl:template>
=======
<!-- Namespace substitution for hdoc elements -->
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>
>>>>>>> 112cef1ed5bea6c90a2ef0bdff0e2d981478d5da
</xsl:stylesheet>
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