Custom JSP taglib that lets you iterate over some set (collection) of beans and prepare the output in XML format. And the final idea is to use XSLT stuff for publishing your data. This taglib is similar to the XSQL taglib but instead of the direct connection to database you can use a collection of objects.
For example, lists the collection of beans:
Here source parameter describes a collection (array, enumeration etc.) of bean.
Instead of that we can provide a name for the attribute (in the page, request, session or applcation scope). E.g.:
Tag iterates over the given collection and outputs (inserts into page) its elements in XML format. Names for the properties describe what methods will be called for getting values. E.g. property name age corresponds to the call getName() etc. By default tag will use all the properties.
So this tag outputs XML text and now you may use for example XSL
taglib for an appropriate transformation:
XML data will be presented as a collection of rows where the each row is a
set of properties:
so for the above mentioned example (selected properties are name and age)
it will be some like this:
and you may use stylesheet like this for presenting data in HTML table for
example:
Any null value will be presented as an empty string.
Tags are:
XBean
Body tag iterates over the given collection of beans and presents them in XML format. Parameters are:
getProperty
Body tag defines a name for the property. Parameters: none
for downloading:
Library: xbeantag.jar
Description: taglib.tld
See also Coldtags suite - the largest collection of custom JSP tags.
2) name Optional parameter. Describes a name for the attribute (in page, request, session or
application scope) that will keep your collection.
3) xsl Optional parameter. Describes an URL for XSL stylesheet (if you will use client side XSL formatting)