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"
|
<xsl:stylesheet version="1.0"
|
||||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
exclude-result-prefixes="svg"
|
exclude-result-prefixes="svg"
|
||||||
>
|
>
|
||||||
|
|
||||||
@ -94,6 +95,9 @@ xsltproc --novalid --nonet - "$infile" <<EOF
|
|||||||
<head>
|
<head>
|
||||||
<xsl:apply-templates select="svg:svg/svg:title"/>
|
<xsl:apply-templates select="svg:svg/svg:title"/>
|
||||||
<xsl:apply-templates select="svg:svg/svg:desc"/>
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<xsl:apply-templates select="//svg:text"/>
|
<xsl:apply-templates select="//svg:text"/>
|
||||||
@ -111,6 +115,36 @@ xsltproc --novalid --nonet - "$infile" <<EOF
|
|||||||
</xsl:text>
|
</xsl:text>
|
||||||
</xsl:template>
|
</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">
|
<xsl:template match="svg:title">
|
||||||
<title><xsl:value-of select="."/></title><xsl:text>
|
<title><xsl:value-of select="."/></title><xsl:text>
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
|
|||||||
@ -179,7 +179,10 @@ class Doc {
|
|||||||
} else if (mit->second.empty()) {
|
} else if (mit->second.empty()) {
|
||||||
mit->second = value;
|
mit->second = value;
|
||||||
} else {
|
} 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,6 @@ abstract = XS
|
|||||||
caption = S
|
caption = S
|
||||||
title = S
|
title = S
|
||||||
subject = S
|
subject = S
|
||||||
author = A
|
|
||||||
keywords= K
|
keywords= K
|
||||||
xapyear = Y
|
xapyear = Y
|
||||||
xapyearmon = M
|
xapyearmon = M
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user