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
e90027c6
Commit
e90027c6
authored
Dec 15, 2016
by
Nyashes
Browse files
h2m: modifications
parent
798a47f5
Changes
5
Hide whitespace changes
Inline
Side-by-side
hdoc_to_mongo/subroutines/author.xsl
View file @
e90027c6
...
...
@@ -4,8 +4,8 @@
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:h2m=
"http://www.utc.fr/hdoc/hdoc_to_mongo"
>
<xsl:import
href=
"../xsl-import/string.xsl"
/>
<xsl:template
match=
"/html/head"
name=
"author-main"
>
<xsl:value-of
select=
"h2m:escape-string(meta[@name='author']/@content)"
/>
<xsl:template
name=
"author-main"
>
<xsl:value-of
select=
"h2m:escape-string(
/html/head/
meta[@name='author']/@content)"
/>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
hdoc_to_mongo/subroutines/keyword.xsl
View file @
e90027c6
...
...
@@ -4,7 +4,7 @@
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:h2m=
"http://www.utc.fr/hdoc/hdoc_to_mongo"
>
<xsl:import
href=
"../xsl-import/array.xsl"
/>
<xsl:template
match=
"/html/head"
name=
"keyword-main"
>
<xsl:value-of
select=
"h2m:array(meta[@name='keywords']/@content)"
/>
<xsl:template
name=
"keyword-main"
>
<xsl:value-of
select=
"h2m:array(
/html/head/
meta[@name='keywords']/@content)"
/>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
hdoc_to_mongo/subroutines/right.xsl
View file @
e90027c6
...
...
@@ -4,8 +4,8 @@
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:h2m=
"http://www.utc.fr/hdoc/hdoc_to_mongo"
>
<xsl:import
href=
"../xsl-import/string.xsl"
/>
<xsl:template
match=
"/html/head"
name=
"right-main"
>
<xsl:value-of
select=
"h2m:escape-string(meta[@name='rights']/@content)"
/>
<xsl:template
name=
"right-main"
>
<xsl:value-of
select=
"h2m:escape-string(
/html/head/
meta[@name='rights']/@content)"
/>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
hdoc_to_mongo/subroutines/title.xsl
View file @
e90027c6
...
...
@@ -4,7 +4,20 @@
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:h2m=
"http://www.utc.fr/hdoc/hdoc_to_mongo"
>
<xsl:import
href=
"../xsl-import/string.xsl"
/>
<xsl:template
match=
"/html/head"
name=
"title-main"
>
<xsl:value-of
select=
"h2m:escape-string(title/text())"
/>
<xsl:template
name=
"title-main"
>
<xsl:choose>
<xsl:when
test=
"../section"
>
<xsl:call-template
name=
"title-section"
></xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template
name=
"title-rootDocument"
></xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template
name=
"title-section"
>
<xsl:value-of
select=
"h2m:escape-string(header/h1/text())"
/>
</xsl:template>
<xsl:template
name=
"title-rootDocument"
>
<xsl:value-of
select=
"h2m:escape-string(/html/head/title/text())"
/>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
hdoc_to_mongo/xsl-import/array.xsl
View file @
e90027c6
...
...
@@ -2,13 +2,14 @@
<xsl:stylesheet
version=
"2.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:h2m=
"http://www.utc.fr/hdoc/hdoc_to_mongo"
>
<xsl:import
href=
"../xsl-import/string.xsl"
/>
<xsl:function
name=
"h2m:array"
>
<xsl:param
name=
"nodeset"
/>
[
<xsl:for-each
select=
"$nodeset[not(position() = last())]"
>
"
<xsl:value-of
select=
"
.
"
/>
"
,
<xsl:value-of
select=
"
h2m:escape-string(.)
"
/>
,
</xsl:for-each>
<xsl:value-of
select=
"$nodeset[last()]"
/>
<xsl:value-of
select=
"
h2m:escape-string(
$nodeset[last()]
)
"
/>
]
</xsl:function>
</xsl:stylesheet>
\ No newline at end of file
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