Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 21st, 2007, 03:01 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Xsl and Jsp

Hi,

I have a java class and a jsp. This jsp is showing the output in a drop down which containg all the values of a column from the database table. I need to display the same dropdown by xslt in html output. I have a cariable name called atoztopics in my JSP that is displaying all the values from an array while calling a java class.
How can i use this variable in xslt to call the same java class with same output values in the dropdown. I am getting dropdown in the html output when i am running my xslt but i am not getting any values in the dropdown as i am getting the same values in jsp.

My xslt is look like this :

<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "#160;"> ]>

<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output method="html" encoding="UTF-8" indent="yes"/>

    <xsl:param name="outputContext" />
    <xsl:param name="formInputValue" />
    <xsl:param name="formInputName" />
    <xsl:param name="considerDefault" />
    <xsl:param name="visible" />
    <xsl:param name="disable" />
    <xsl:param name="currentUser" />


    <xsl:template match="/">

        <xsl:choose>
            <xsl:when test="$visible='true'">

                <xsl:choose>
                    <xsl:when test="$outputContext='head'">
                        <xsl:apply-templates select="child::*" mode="head"/>
                    </xsl:when>
                    <xsl:when test="$outputContext='body'">
                        <xsl:apply-templates select="child::*" mode="body"/>
                    </xsl:when>
                </xsl:choose>
            </xsl:when>
        </xsl:choose>
    </xsl:template>


    <xsl:template match="child::*" mode="head">
    </xsl:template>



    <xsl:template match="child::*" mode="body">







        <xsl:variable name="atoZTopics" select="$formInputName" />

        <xsl:variable name="val">
            <xsl:choose>

                <xsl:when test="normalize-space($formInputValue)">
                    <xsl:value-of select="normalize-space($formInputValue)"/>
                </xsl:when>
            </xsl:choose>
        </xsl:variable>

        <select class="vign-formElementControl" name="{$atoZTopics}" id="{$atoZTopics}">
            <xsl:if test="$disable='true'">
                <xsl:attribute name="disabled">disabled</xsl:attribute>
            </xsl:if>



        <xsl:for-each select="row">
                <xsl:variable name="name" select="name"/>
                <xsl:variable name="value" select="value"/>
                <xsl:variable name="selected" select="selected"/>

                <xsl:choose>
                    <xsl:when test="$selected='1'">
                        <option value="{$value}"><xsl:attribute name="selected">selected</xsl:attribute><xsl:value-of select="$name"/></option>
                    </xsl:when>
                    <xsl:otherwise>
                        <option value="{$value}"><xsl:value-of select="$name"/></option>
                    </xsl:otherwise>
                </xsl:choose>
                <xsl:value-of select="$name"/><br/>

            </xsl:for-each>
        </select>


    </xsl:template>
</xsl:stylesheet>


Could you please help me ..how to get the desired out put from this xsl. Where and how to pass the values in xsl.
Please do the needful.

Thanks
Vipin





Similar Threads
Thread Thread Starter Forum Replies Last Post
Xsl and Jsp kumars_vipin XSLT 1 June 21st, 2007 05:37 AM
how to include jsp page in xsl vijayanmsc XSLT 2 August 23rd, 2006 05:04 AM
.XSL and .JSP problem(docktype) gps Ajax 0 August 3rd, 2006 11:22 AM
Transforming JSP to WML using XSL crispycasper XML 0 May 15th, 2004 12:40 AM
XSL Transform with xsl string NOT xsl file skin XSLT 0 June 16th, 2003 07:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.