Skip to content
GitLab
Menu
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
200ec902
Commit
200ec902
authored
Dec 07, 2015
by
Jean-Baptiste Martin
Browse files
fix the <meta name="keywords"/> tag process according to Opale's schema
parent
9e132fb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
hdoc_to_opale/xsl/transformation2.xsl
View file @
200ec902
...
...
@@ -5,6 +5,7 @@
xmlns:sc=
"http://www.utc.fr/ics/scenari/v3/core"
xmlns:op=
"utc.fr:ics/opale3"
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"
/>
...
...
@@ -25,7 +26,12 @@
</sp:title>
<sp: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 -->
<xsl:if
test=
"./h:meta[@name='author']"
>
...
...
@@ -58,17 +64,27 @@
</xsl:if>
</xsl:for-each>
</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:choose>
<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. -->
<sp:keywds>
<op:keywds>
<sp:keywd><xsl:value-of
select=
"./@content"
/></sp:keywd>
</op:keywds>
</sp:keywds>
</xsl:when>
<xsl:when
test=
"./@name = 'keywords'"
/>
<!-- Done above -->
<xsl:when
test=
"./@name = 'author'"
/>
<!-- Done above -->
<xsl:when
test=
"./@name = 'rights'"
>
<xsl:choose>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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