You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Richardella, Anthony" <An...@sra.com> on 2000/12/12 21:01:00 UTC

Variable trouble

I'm using a program that modifies a DOM based on an external event, creates
an "representation changed event" and sends it to an object that transforms
the DOM using a StylesheetRoot. Sometimes the changes to the DOM occur very
quickly (but still inside the event thread). When this happens I get a
sequence of errors about a variable I'm using not being defined. A simple
stylesheet is,

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:variable name="test">this is a test</xsl:variable>

<xsl:template match="/">
	<output>
	<xsl:value-of select="$test"/>
	</output>
</xsl:template>

</xsl:stylesheet>


The error messages look like,

TrivialRepresentationChangedListener: Representation changed.
TrivialRepresentationChangedListener: Representation changed.
XSL Error: pattern = '$test'
VariableReference given for variable out of context or without definition!
Name = 
test, source tree node: #document
Exception: org.apache.xalan.xpath.XPathException: pattern = '$test'
VariableReference given for variable out of context or without definition!
Name = 
test
TrivialRepresentationChangedListener: Representation changed.
TrivialRepresentationChangedListener: Representation changed.
XSL Error: pattern = '$test'
VariableReference given for variable out of context or without definition!
Name = 
test, source tree node: #document
Exception: org.apache.xalan.xpath.XPathException: pattern = '$test'
VariableReference given for variable out of context or without definition!
Name = 
test
TrivialRepresentationChangedListener: Representation changed.
TrivialRepresentationChangedListener: Representation changed.
XSL Error: pattern = '$test'
VariableReference given for variable out of context or without definition!
Name = 
test, source tree node: #document
Exception: org.apache.xalan.xpath.XPathException: pattern = '$test'
VariableReference given for variable out of context or without definition!
Name = 
test
TrivialRepresentationChangedListener: Representation changed.
TrivialRepresentationChangedListener: Representation changed.
XSL Error: pattern = '$test'
VariableReference given for variable out of context or without definition!
Name = 
test, source tree node: #document
Exception: org.apache.xalan.xpath.XPathException: pattern = '$test'
VariableReference given for variable out of context or without definition!
Name = 
test

There are no other error messages created when the stylesheet is created,
only every second time that the (possibily modified) DOM object is
transformed.

Anthony