[4suite] More unexplained behavior of 4XLST

Bob Myers rtm at pacifitech.com
Fri Sep 22 15:52:58 MDT 2000


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>

%4xslt bug.xsl bug.xml
Traceback (innermost last):
  File "/usr/lib/python1.5/site-packages/xml/xslt/4xslt.py", line 68, in ?
    validate=validate_flag)
  File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 118,
in runUri
    result = self.runNode(src, ignorePis, topLevelParams, writer, uri)
  File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 171,
in runNode
    self.applyTemplates(context, None)
  File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 189,
in applyTemplates
    self.applyBuiltins(context, mode)
  File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 202,
in applyBuiltins
    self.applyTemplates(context, mode)
  File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 189,
in applyTemplates
    self.applyBuiltins(context, mode)
  File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 202,
in applyBuiltins
    self.applyTemplates(context, mode)
  File "/usr/lib/python1.5/site-packages/xml/xslt/Processor.py", line 185,
in applyTemplates
    found = sty.applyTemplates(context, mode, self, params)
  File "/usr/lib/python1.5/site-packages/xml/xslt/Stylesheet.py", line 275,
in applyTemplates
    patternInfo[TEMPLATE].instantiate(context, processor, params)
  File "/usr/lib/python1.5/site-packages/xml/xslt/TemplateElement.py", line
143, in instantiate
    context = child.instantiate(context, processor)[0]
  File "/usr/lib/python1.5/site-packages/xml/xslt/TextElement.py", line 35,
in instantiate
    value = self.firstChild.data
AttributeError: data

It seems like all other variations of the value for the "select" attribute
also fair, including ones such as "position()".

I am probably missing something very basic, but any help would be
appreciated.

Whatever is causing the above bug is apparently also causing a bug in the
use of the <xsl:number> instruction.

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.

Thanks in advance.

Bob Myers

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.svg
Type: image/svg-xml
Size: 24457 bytes
Desc: not available
Url : http://lists.fourthought.com/pipermail/4suite/attachments/20000922/0e1f5b35/test.bin


More information about the 4suite mailing list