You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Dylan MacDonald <dm...@gnx.com> on 2004/03/22 19:14:43 UTC

XML parse and filter expression

Hi -

I am using the jstl xml tags to list out my company's press releases on our
web site.  The XML file I created lists 50 PRs and the JSP page imports that
XML file and then displays each one using the x:forEach tag.

The trouble I'm having is that I have another JSP page I need to create that
should display only the first three PRs from that XML file.  I see that
x:forEach does not support the "begin" and "end" parameters.  This leads me
to think I need to limit the number of records from the XML document I'm
importing rather than import them all then limit the number I display.  So
my guess is that I need to write a filter expression in the x:parse tag to
retrieve just the first three records.

Am I on the right track?  And, if so, any ideas on how to write this filter?

Thanks,

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Dylan MacDonald
Senior Web Designer
GNX
phone: 415-283-3715
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


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


RE: XML parse and filter expression

Posted by Kris Schneider <kr...@dotech.com>.
Glad it helped, good luck...

Quoting Dylan MacDonald <dm...@gnx.com>:

> Perfect!  Thank you SO much!
> 
> - Dylan
> 
> 
> -----Original Message-----
> From: Kris Schneider [mailto:kris@dotech.com]
> Sent: Monday, March 22, 2004 10:36 AM
> To: Tag Libraries Users List; dmacdonald@gnxchange.com
> Subject: Re: XML parse and filter expression
> 
> 
> Actually, it sounds like you just need a little XPath magic in the
> <x:forEach>
> to limit it to the first three PRs.
> 
> <x:forEach select="$doc/root/child[position()<4]">
>   ...
> </x:forEach>
> 
> Quoting Dylan MacDonald <dm...@gnx.com>:
> 
> > Hi -
> >
> > I am using the jstl xml tags to list out my company's press releases on
> our
> > web site.  The XML file I created lists 50 PRs and the JSP page imports
> that
> > XML file and then displays each one using the x:forEach tag.
> >
> > The trouble I'm having is that I have another JSP page I need to create
> that
> > should display only the first three PRs from that XML file.  I see that
> > x:forEach does not support the "begin" and "end" parameters.  This leads
> me
> > to think I need to limit the number of records from the XML document I'm
> > importing rather than import them all then limit the number I display.  So
> > my guess is that I need to write a filter expression in the x:parse tag to
> > retrieve just the first three records.
> >
> > Am I on the right track?  And, if so, any ideas on how to write this
> filter?
> >
> > Thanks,
> >
> > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> > Dylan MacDonald
> > Senior Web Designer
> > GNX
> > phone: 415-283-3715
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 
> --
> Kris Schneider <ma...@dotech.com>
> D.O.Tech       <http://www.dotech.com/>

-- 
Kris Schneider <ma...@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


RE: XML parse and filter expression

Posted by Dylan MacDonald <dm...@gnx.com>.
Perfect!  Thank you SO much!

- Dylan


-----Original Message-----
From: Kris Schneider [mailto:kris@dotech.com]
Sent: Monday, March 22, 2004 10:36 AM
To: Tag Libraries Users List; dmacdonald@gnxchange.com
Subject: Re: XML parse and filter expression


Actually, it sounds like you just need a little XPath magic in the
<x:forEach>
to limit it to the first three PRs.

<x:forEach select="$doc/root/child[position()<4]">
  ...
</x:forEach>

Quoting Dylan MacDonald <dm...@gnx.com>:

> Hi -
>
> I am using the jstl xml tags to list out my company's press releases on
our
> web site.  The XML file I created lists 50 PRs and the JSP page imports
that
> XML file and then displays each one using the x:forEach tag.
>
> The trouble I'm having is that I have another JSP page I need to create
that
> should display only the first three PRs from that XML file.  I see that
> x:forEach does not support the "begin" and "end" parameters.  This leads
me
> to think I need to limit the number of records from the XML document I'm
> importing rather than import them all then limit the number I display.  So
> my guess is that I need to write a filter expression in the x:parse tag to
> retrieve just the first three records.
>
> Am I on the right track?  And, if so, any ideas on how to write this
filter?
>
> Thanks,
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> Dylan MacDonald
> Senior Web Designer
> GNX
> phone: 415-283-3715
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

--
Kris Schneider <ma...@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


Re: XML parse and filter expression

Posted by Kris Schneider <kr...@dotech.com>.
Actually, it sounds like you just need a little XPath magic in the <x:forEach>
to limit it to the first three PRs.

<x:forEach select="$doc/root/child[position()<4]">
  ...
</x:forEach>

Quoting Dylan MacDonald <dm...@gnx.com>:

> Hi -
> 
> I am using the jstl xml tags to list out my company's press releases on our
> web site.  The XML file I created lists 50 PRs and the JSP page imports that
> XML file and then displays each one using the x:forEach tag.
> 
> The trouble I'm having is that I have another JSP page I need to create that
> should display only the first three PRs from that XML file.  I see that
> x:forEach does not support the "begin" and "end" parameters.  This leads me
> to think I need to limit the number of records from the XML document I'm
> importing rather than import them all then limit the number I display.  So
> my guess is that I need to write a filter expression in the x:parse tag to
> retrieve just the first three records.
> 
> Am I on the right track?  And, if so, any ideas on how to write this filter?
> 
> Thanks,
> 
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> Dylan MacDonald
> Senior Web Designer
> GNX
> phone: 415-283-3715
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-- 
Kris Schneider <ma...@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