Custom JSP tags. Lets you apply the given XSL stylesheet to
the given XML data and rendering the output to your JSP page. You may set an XML data as
and XSL data you may set as
For example:
<%@ taglib uri="taglib.tld" prefix="xslt" %> <html> <!-- use two files: XML data and XSL styleshhet --> <xslt:applyXSL xmlData="data.xml" xslData="sheet.xsl"/> <!-- use XSL stylesheet and XML body --> <xslt:applyXSL xslData="sheet.xsl"> <xslt:setXML> <?xml version="1.0" encoding="ISO-8859-1"?> <users> <user> <id>123</id> <name>John</name></user> <user> <id>456</id> <name>Steve</name></user> </users> </xslt:setXML> </xslt:applyXSL> <!-- use XML string and XSL stylesheet with parameter --> <% String s; // accumulate XML data s="your XML data"; %> <xslt:applyXSL xmlString="<%=s%>" xslData="sheet.xsl"> <xslt:setParameter name="myParam"> value for param </xslt:setParameter> </xslt:applyXSL> </html> Tags are: applyXSL Body tag lets you apply the given XSL stylesheet to the given XML data and rendering the output to your JSP page. Parameters are: 1) xmlString Describes a string with XML data (see setXML tag also)
setXML Body tag lets you set XML data. You can use this tag inside of applyXSL. Parameters are: none setXSL Body tag lets you set XSL data. You can use this tag inside of applyXSL. Parameters are: 1) systemId Optional parameter. Describes a name systemId for your XSL data. Must be a String that conforms to the URI syntax. setParameter Body tag lets you set a parameter for XSL stylesheet. Tag's body describes a value for parameter. You can use this tag inside of applyXSL. Parameters are: 1) name Describes a name for your parameter
Notes: 1. Taglib uses JAXP for parsing XML files
.
for downloading: Library: xsltag.jar Description: taglib.tld © Coldbeans Software Comments? See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|