3
1-n Path要素を持つsvgドキュメントがいくつかあります。これらのパス要素の色を変更したかったのです。XSLTを使用してタグに属性を追加する
私が行うための方法を発見していないしている。この
のSVG文書例:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" height="45" width="45" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<g transform="matrix(1.25,0,0,-1.25,0,45)">
<path d="m9 18h18v-3h-18v3"/>
</g>
</svg>
XSLT:私はそれを追加するために変更する必要が何
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' version='1.0'>
<xsl:template match='path'>
<xsl:copy>
<xsl:attribute name='fill'>red</xsl:attribute>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
/塗りつぶし属性を赤に変更しますか?
ありがとう! – Peter