[4suite] More unexplained behavior of 4XLST
Uche Ogbuji
uche.ogbuji at fourthought.com
Fri Sep 22 17:05:11 MDT 2000
Bob Myers wrote:
>
> Hi. I am having no luck getting the <xsl:value-of> element to work. (I am
> using version 0.9.0 of 4Suite, downloaded and installed a couple of days
> ago.)
>
> % cat bug.xsl
> <?xml version="1.0"?>
> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>
> <xsl:template match="at">
> <xsl:text><xsl:value-of select="@x"/></xsl:text>
> </xsl:template>
>
> </xsl:transform>
>
> % cat bug.xml
> <?xml version="1.0"?>
> <doc>
> <at x='1' y='2'/>
> </doc>
[snipped traceback]
Actually, there are two bugs here. The first one is in your stylesheet.
xsl:text is not allowed to have any child tags. Only character data
(text) (see section 7.3 of the spec). Your stylesheet works as
<?xml version="1.0"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="at">
<xsl:value-of select="@x"/>
</xsl:template>
</xsl:transform>
However, there is a buglet in 4XSLT: it should throw a more intelligent
message than the traceback you got. This is an area we're really trying
to improve in 4Suite: error reports. I've addressed illegal xsl:text
children thanks to your message.
> Whatever is causing the above bug is apparently also causing a bug in the
> use of the <xsl:number> instruction.
Hmm. Can I have more info about your problems with xsl:number? It
should be unrelated.
> PS. This is part of an application I am developing to represent the
> Japanese game of go in xml, and the style sheet above is a fragment of one
> to convert such a game into an SVG graphic. Such a graphic (created by
> other means) is attached for your amusement.
I checked it out with the Adobe viewer. Very slick. Are you planning
to use the animation features of SVG for things like illustrating moves?
Thanks.
--
Uche Ogbuji Principal Consultant
uche.ogbuji at fourthought.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python
More information about the 4suite
mailing list