You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Juergen Hermann <jh...@webde-ag.de> on 2000/05/24 12:29:34 UTC

Problem with stylesheet parameters

Hi!

I have the following code with Xalan 0.30.0:

void XMLStylesheet::setParameter(const DOMString& name, const DOMString& value)
{
#if 0
    XObject* xval = m_impl->m_XPathExecutionContext.getXObjectFactory().createString(value);
    m_impl->processor().setStylesheetParam(name, xval);
#else
    m_impl->processor().setStylesheetParam(name, value);
#endif
}


What I eventually get (using the code in #if 0) is this:

Parameter title = XSLT Test 392AAFD0-598B-0001
Transforming...
VariableReference given for variable out of context or without definition!  Name = title, at line number 0 at offset 0
VariableReference given for variable out of context or without definition!  Name = title, at line number 0 at offset 0
transform took 10 millis

(the parameter is referenced twice in the stylesheet, and it does not crash,
but it also does not insert the value; btw, the xval pointer above is non-NULL)

Using the second variant, and "'XSLT Test...'" (i.e. a quoted XPath string 
expression), everything works as expected.

Any clues?


Ciao, Jürgen

--
Jürgen Hermann (jhe@webde-ag.de)
WEB.DE AG, Amalienbadstr.41, D-76227 Karlsruhe
Tel.: 0721/94329-0, Fax: 0721/94329-22