Commit e624ade4 authored by jcomedouteau's avatar jcomedouteau

Merge branch 'etherpad' of https://gitlab.utc.fr/crozatst/hdoc into etherpad

parents 62895a55 689bb604
File mode changed from 100644 to 100755
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.utc.fr/ics/hdoc/xhtml" exclude-result-prefixes="xs">
<xsl:output method="xml" indent="yes"></xsl:output>
<xsl:strip-space elements="*"/>
<xsl:param name="text-encoding" as="xs:string" select="'utf-8'"/>
<xsl:param name="text-uri" as="xs:string" select="'file:///G:/Documents/Dropbox/NF29/etherpad/antce/input/NF29_HdocEtherpad.etherpad'"/>
<xsl:template name="text2xml">
<xsl:variable name="text" select="unparsed-text($text-uri, $text-encoding)"/>
<xsl:analyze-string select="$text" regex='\{{"atext":\{{"text":"(.*?)",'>
<xsl:matching-substring>
<div>
<p>
<xsl:value-of select="normalize-space(regex-group(1))"/>
</p>
</div>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:template>
<xsl:template match="/">
<html>
<head>
<title>Etherpad</title>
<meta charset="utf-8"/>
</head>
<body>
<section>
<header>
<h1>Contenu</h1>
</header>
<xsl:choose>
<xsl:when test="unparsed-text-available($text-uri, $text-encoding)">
<xsl:call-template name="text2xml"/>
</xsl:when>
</xsl:choose>
</section>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
......@@ -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="'../input/test.html'"/>
<xsl:param name="text-uri" as="xs:string" select="'../tmp/pad-clean.xml'"/>
<xsl:template name="text2xml">
<xsl:variable name="text" select="unparsed-text($text-uri, $text-encoding)"/>
......
......@@ -4,6 +4,12 @@
xmlns="http://www.utc.fr/ics/hdoc/xhtml" version="2.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="p[child::ul or child::ol]" priority="1">
<xsl:apply-templates select="./*"></xsl:apply-templates>
</xsl:template>
<!--Identity template,
provides default behavior that copies all content into the output -->
<xsl:template match="@*|node()">
......@@ -11,20 +17,5 @@
<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
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
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