Commit 9fb7f670 authored by Nyashes's avatar Nyashes

h2m: ajout des fonction author, keyword, h2m:array()

parent 75c39a3c
<?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
<?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
<?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
<?xml version="1.0" encoding="UTF-8"?>
[
1,
2,
3
]
\ No newline at end of file
<?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
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