OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Conditionals to modify SVG



Hello all,

I'm struggling with setting variables in a XSL template to modify attributes
of an SVG.

FO: (simplified for this issue)

<xsl:template match="symbol[@role='lang']" name="lang.icon">
		<fo:inline>
			<fo:instream-foreign-object>
				<svg:svg xmlns="http://www.w3.org/2000/svg";
x="0" y="0" width="32.96" height="17.77" viewBox="0 0 32.967 17.775">
					<svg:g>
						<svg:ellipse cx="16.483000"
cy="8.8870001" rx="15.984000" ry="8.3870001">

<xsl:attribute name="style">
								<xsl:choose>
								<xsl:when
test="parent::bookinfo">

<xsl:value-of select="'fill:none;stroke:#008066'"/>

</xsl:when><xsl:otherwise>

<xsl:value-of select="'fill:none;stroke:#000000'"/>

</xsl:otherwise></xsl:choose>

</xsl:attribute>
						</svg:ellipse>
						<svg:g id="switch1588">
							<svg:text
transform="translate(9.736800,12.70650)" id="XMLID_6_">
								<svg:tspan
x="0" y="0"  id="tspan1605"
style="font-size:10px;font-family:Arial;">EN</svg:tspan>
							</svg:text>
						</svg:g>
					</svg:g>
				</svg:svg>
			</fo:instream-foreign-object>
		</fo:inline>
	</xsl:template>

XML: (simplified for this issue)
<book>
<title/>
<bookinfo>
<title/>
	<para lang="en"><symbol role="lang" lang="en"/> SMALL CRAFT OWNER'S
MANUAL</para>
</bookinfo>
</book>

Problem is the conditional statement in the FO template <xsl:attribute
name="style">, specifically <xsl:when test="parent::bookinfo"> doesn't work
for the XML above.  How
Can I set this when condition to be true for the XML above so the SVG gets a
stroke of green instead of black?

Thanks,

David White




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]