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
9fb7f670
Commit
9fb7f670
authored
Dec 15, 2016
by
Nyashes
Browse files
h2m: ajout des fonction author, keyword, h2m:array()
parent
75c39a3c
Changes
5
Hide whitespace changes
Inline
Side-by-side
hdoc_to_mongo/subroutines/author.xsl
0 → 100644
View file @
9fb7f670
<?xml version="1.0" encoding="UTF-8"?>
<?target hdoc/content.xml ?>
<?main author-main?>
<xsl:stylesheet
version=
"2.0"
xpath-default-namespace=
"http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:h2m=
"http://www.utc.fr/hdoc/hdoc_to_mongo"
xmlns:h2ma=
"http://www.utc.fr/hdoc/hdoc_to_mongo/author"
>
<xsl:import
href=
"../xsl-import/array.xsl"
/>
<xsl:template
match=
"text()"
></xsl:template>
<xsl:template
match=
"/html/head"
>
authors: "
<xsl:value-of
select=
"meta[@name='author']/@content"
/>
"
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
hdoc_to_mongo/subroutines/keyword.xsl
0 → 100644
View file @
9fb7f670
<?xml version="1.0" encoding="UTF-8"?>
<?target hdoc/content.xml ?>
<?main author-main?>
<xsl:stylesheet
version=
"2.0"
xpath-default-namespace=
"http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:h2m=
"http://www.utc.fr/hdoc/hdoc_to_mongo"
xmlns:h2ma=
"http://www.utc.fr/hdoc/hdoc_to_mongo/author"
>
<xsl:import
href=
"../xsl-import/array.xsl"
/>
<xsl:template
match=
"text()"
></xsl:template>
<xsl:template
match=
"/html/head"
>
keywords:
<xsl:value-of
select=
"h2m:array(meta[@name='keywords']/@content)"
/>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
hdoc_to_mongo/xsl-import/array.xsl
0 → 100644
View file @
9fb7f670
<?xml version="1.0" encoding="UTF-8"?>
<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:function
name=
"h2m:array"
>
<xsl:param
name=
"nodeset"
/>
[
<xsl:for-each
select=
"$nodeset[not(position() = last())]"
>
"
<xsl:value-of
select=
"."
/>
",
</xsl:for-each>
<xsl:value-of
select=
"$nodeset[last()]"
/>
]
</xsl:function>
</xsl:stylesheet>
\ No newline at end of file
hdoc_to_mongo/xsl-import/test.html
0 → 100644
View file @
9fb7f670
<?xml version="1.0" encoding="UTF-8"?>
[
1,
2,
3
]
\ No newline at end of file
hdoc_to_mongo/xsl-import/test.xml
0 → 100644
View file @
9fb7f670
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="array.xsl"?>
<root>
<ul>
<li
value=
"1"
/>
<li
value=
"2"
/>
<li
value=
"3"
/>
</ul>
</root>
\ No newline at end of file
Write
Preview
Markdown
is supported
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