Commit 200ec902 authored by Jean-Baptiste Martin's avatar Jean-Baptiste Martin

fix the <meta name="keywords"/> tag process according to Opale's schema

parent 9e132fb5
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
xmlns:sc="http://www.utc.fr/ics/scenari/v3/core" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
xmlns:op="utc.fr:ics/opale3" xmlns:op="utc.fr:ics/opale3"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
> >
<xsl:output method="xml" indent="yes" encoding="UTF-8"/> <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
...@@ -25,7 +26,12 @@ ...@@ -25,7 +26,12 @@
</sp:title> </sp:title>
<sp:info> <sp:info>
<op:info> <op:info>
<xsl:apply-templates select="./h:meta"/> <sp:keywds>
<op:keywds>
<xsl:apply-templates select="//h:meta[@name='keywords']"/> <!-- Keywords tag is processed separatly -->
</op:keywds>
</sp:keywds>
<xsl:apply-templates select="./h:meta[@name != 'keywords']"/>
<!-- Author: in case several authors are specified, we don't want to get an error for not respecting the schema --> <!-- Author: in case several authors are specified, we don't want to get an error for not respecting the schema -->
<xsl:if test="./h:meta[@name='author']"> <xsl:if test="./h:meta[@name='author']">
...@@ -58,17 +64,27 @@ ...@@ -58,17 +64,27 @@
</xsl:if> </xsl:if>
</xsl:for-each> </xsl:for-each>
</xsl:template> </xsl:template>
<!--
The keywords tag is processed separatly
because according to the Hdoc Rng schema
there might be multiple <meta name="keywords" tags
This allow us to treat all the different tags
and merge them according to Opale schema
-->
<xsl:template match="h:meta[@name='keywords']" priority="1">
<xsl:for-each select="fn:tokenize(./@content,',')">
<sp:keywd>
<xsl:value-of select="normalize-space(.)"/>
</sp:keywd>
</xsl:for-each>
</xsl:template>
<xsl:template match="h:meta[@name]"> <xsl:template match="h:meta[@name]">
<xsl:choose> <xsl:choose>
<xsl:when test="./@name = 'description'"/> <!-- Unsupported : Opale doesn't provide any description metadata. --> <xsl:when test="./@name = 'description'"/> <!-- Unsupported : Opale doesn't provide any description metadata. -->
<xsl:when test="./@name = 'keywords'"> <!-- This is the least to do, since there's no specific format for keywords in hdoc. --> <xsl:when test="./@name = 'keywords'"/> <!-- Done above -->
<sp:keywds>
<op:keywds>
<sp:keywd><xsl:value-of select="./@content"/></sp:keywd>
</op:keywds>
</sp:keywds>
</xsl:when>
<xsl:when test="./@name = 'author'"/> <!-- Done above --> <xsl:when test="./@name = 'author'"/> <!-- Done above -->
<xsl:when test="./@name = 'rights'"> <xsl:when test="./@name = 'rights'">
<xsl:choose> <xsl:choose>
......
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