Hi, Marco.
"Marco Laponder" <[EMAIL PROTECTED]> wrote on 2005-01-25 01:54:47 AM:
> > I have the following xsl document:
> >
> > ....
> > <xsl:variable name="testvar" >
> > <test>
> > <subtest/>
> > </test>
> > </xsl:variable>
> > ....
> >
> > I added a tracer object and in de trace event I have the
> > following code:
> >
> > ElemVariable elv
> > =ev.m_styleNode.getStylesheetRoot().getVariableOrParamComposed
> > (new QName("testvar"));
> > if ( elv != null) {
> > int sourceNode =
> > ev.m_processor.getXPathContext().getCurrentNode();
> > XObject var = elv.getValue(ev.m_processor, sourceNode);
> > if ( var instanceof XRTreeFrag) {
> > XRTreeFrag tf = (XRTreeFrag) var;
> > String outputString = tf.str();
> > }
> > }
> >
> > It reaches the tf.str() statement is reached as expected but
> > the outputString is empty. Can anybody tell me what is going
> > wrong ? How can I get a string representation of the XRTreeFrag ?
When you posted this the first time, I thought it was a C++ issue,
because the subject appeared to be using C++ syntax.
I can tell you what's going wrong: XObject.str() produces the string
value of the result tree fragment in the XPath sense - that is, it's
equivalent to evaluating the XPath expression "string($testvar)". In this
case, the result is the empty string.
Thanks,
Henry
------------------------------------------------------------------
Henry Zongaro Xalan development
IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044
mailto:[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]