Alex Vincent
06-24-2002, 01:44 AM
Here's an interesting situation. I'm working on an XML language for geometry, but I have a small problem in rendering a symbolism for arcs, rays and lines. For line segments, it's pretty simple: I associate a CSS styling with the element in question:
geo:line[ends="both"] {
text-decoration: overline
}
But beyond that, I need a little help...
For instance, with an arc:
<geo:arc id="ABC">...</geo:arc>
the presentation would need to be in the format:
<svg:g transform="translate(10,20)">
<svg:path d="M 0 10 A 20 10 0 0 1 26 10" fill="none" stroke="#000000" />
<svg:text x="0" y="20" font-family="Times New Roman">ABC</svg:text>
</svg:g>
With a two-letter id attribute for geo:arc, I'd need:
<svg:g transform="translate(10,0)">
<svg:path d="M 0 10 A 20 20 0 0 1 18 10" fill="none" stroke="#000000" />
<svg:text x="0" y="20" font-family="Times New Roman">AB</svg:text>
</svg:g>
A little different, obviously. So I'm wondering how to construct the <xsl:template>...</xsl:template> match attribute to distinguish between a two-character text content and a three-character text content.
Advice?
geo:line[ends="both"] {
text-decoration: overline
}
But beyond that, I need a little help...
For instance, with an arc:
<geo:arc id="ABC">...</geo:arc>
the presentation would need to be in the format:
<svg:g transform="translate(10,20)">
<svg:path d="M 0 10 A 20 10 0 0 1 26 10" fill="none" stroke="#000000" />
<svg:text x="0" y="20" font-family="Times New Roman">ABC</svg:text>
</svg:g>
With a two-letter id attribute for geo:arc, I'd need:
<svg:g transform="translate(10,0)">
<svg:path d="M 0 10 A 20 20 0 0 1 18 10" fill="none" stroke="#000000" />
<svg:text x="0" y="20" font-family="Times New Roman">AB</svg:text>
</svg:g>
A little different, obviously. So I'm wondering how to construct the <xsl:template>...</xsl:template> match attribute to distinguish between a two-character text content and a three-character text content.
Advice?