extract more svg metadata
This commit is contained in:
parent
838ea6d623
commit
2018ef76b8
@ -84,6 +84,7 @@ xsltproc --novalid --nonet - "$infile" <<EOF
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
exclude-result-prefixes="svg"
|
||||
>
|
||||
|
||||
@ -94,6 +95,9 @@ xsltproc --novalid --nonet - "$infile" <<EOF
|
||||
<head>
|
||||
<xsl:apply-templates select="svg:svg/svg:title"/>
|
||||
<xsl:apply-templates select="svg:svg/svg:desc"/>
|
||||
<xsl:apply-templates select="svg:svg/svg:metadata/descendant::dc:creator"/>
|
||||
<xsl:apply-templates select="svg:svg/svg:metadata/descendant::dc:subject"/>
|
||||
<xsl:apply-templates select="svg:svg/svg:metadata/descendant::dc:description"/>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:apply-templates select="//svg:text"/>
|
||||
@ -111,6 +115,36 @@ xsltproc --novalid --nonet - "$infile" <<EOF
|
||||
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dc:creator">
|
||||
<meta>
|
||||
<xsl:attribute name="name">author</xsl:attribute>
|
||||
<xsl:attribute name="content">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</meta><xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dc:subject">
|
||||
<meta>
|
||||
<xsl:attribute name="name">keywords</xsl:attribute>
|
||||
<xsl:attribute name="content">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</meta><xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dc:description">
|
||||
<meta>
|
||||
<xsl:attribute name="name">description</xsl:attribute>
|
||||
<xsl:attribute name="content">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:attribute>
|
||||
</meta><xsl:text>
|
||||
</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="svg:title">
|
||||
<title><xsl:value-of select="."/></title><xsl:text>
|
||||
</xsl:text>
|
||||
|
||||
@ -179,7 +179,10 @@ class Doc {
|
||||
} else if (mit->second.empty()) {
|
||||
mit->second = value;
|
||||
} else {
|
||||
mit->second += string(" - ") + value;
|
||||
// It may happen that the same attr exists several times
|
||||
// in the internfile stack. Avoid duplicating values.
|
||||
if (mit->second != value)
|
||||
mit->second += string(" - ") + value;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ abstract = XS
|
||||
caption = S
|
||||
title = S
|
||||
subject = S
|
||||
author = A
|
||||
keywords= K
|
||||
xapyear = Y
|
||||
xapyearmon = M
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user