tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Goodenough <david.goodeno...@btconnect.com>
Subject Re: <x:if question
Date Fri, 25 Jun 2004 12:38:59 GMT
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

---------------------------------------------------------------------
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