tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: <x:if question
Date Fri, 25 Jun 2004 14:25:44 GMT
JSTL Spec.: 11.1.2 XPath Variable Bindings

Quoting David Goodenough <david.goodenough@btconnect.com>:

> I was not using sessionScope: so that could have been the problem.  I will 
> try it out.  I do not remember seeing sessionScope anywhere, where is
> it documented (I might easily have missed it)?
> 
> I know the datastream is as I think, as the host end logs all requests and
> responses currently.
> 
> Thanks
> 
> David
> 
> On Friday 25 June 2004 14:14, Kris Schneider wrote:
> > So the page has something like:
> >
> > <x:parse var="data" scope="session">
> >   <io:xmlrpc url="..."> <%-- or io:soap, io:http --%>
> >     ...
> >   </io:xmlrpc>
> > </x:parse>
> >
> > <x:if select="$sessionScope:data/root/error">
> >   ...
> > </x:if>
> >
> > If so, that should still work. Every time you run the page, the
> > session-scoped var should be updated. Have you verified that the <io> call
> > is really producing what you think it should? If you don't use
> > $sessionScope:data, but instead just use $data, I guess it's possible you
> > could have a page or request-scoped var also named data that's shadowing
> > the session-scoped var.
> >
> > Quoting David Goodenough <david.goodenough@btconnect.com>:
> > > Yes that is exactly what I meant.  But for some reason (maybe I was
> doing
> > > something else wrong) it did not seem to work.  One possibility is that
> > > the <x:parse var="???" I was using always used the same var, and it
> > > was a scope="session" var.   Could it be that when you do a parse old
> > > values are only cleared out if directly overwritten?
> > >
> > > Thanks
> > >
> > > David
> > >
> > > On Friday 25 June 2004 13:22, Kris Schneider wrote:
> > > > Is this the kind of thing you mean?
> > > >
> > > > <%@ page contentType="text/plain" %>
> > > > <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
> > > >
> > > > <x:parse var="error">
> > > > <root>
> > > >     <error></error>
> > > > </root>
> > > > </x:parse>
> > > >
> > > > <x:parse var="data">
> > > > <root>
> > > >     <data></data>
> > > > </root>
> > > > </x:parse>
> > > >
> > > > error:
> > > > <x:if select="$error/root/error">
> > > > error node exists
> > > > </x:if>
> > > >
> > > > data:
> > > > <x:if select="$data/root/error">
> > > > error node exists
> > > > </x:if>
> > > >
> > > >
> > > > Which produces:
> > > >
> > > > error:
> > > >
> > > > error node exists
> > > >
> > > > data:
> > > >
> > > > In other words, the error node was found in $error but not in $data.
> > > >
> > > > Quoting David Goodenough <david.goodenough@btconnect.com>:
> > > > > I have an application where I send an XML structure to an HTTP host
> > > > > (using the
> > > > > io taglibs) and get an XML response.  That response always has the
> > > > > same root tag, but what comes back either has an <error> (with
> > > > > attributes and children)
> > > > > or some application dependant data.
> > > > >
> > > > > I have tried a variety of values in the <x:if select="", but none
of
> > >
> > > them
> > >
> > > > > quite seem to work.  So my question is, what is the correct syntax
> > > > > for detect
> > > > > the presence (not non-null value) of an XML node?
> > > > >
> > > > > Thanks in advance
> > > > >
> > > > > David

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message