Hi Gurus,
Here is a simple example explaining my problem.
I have a jsp file that retrieves data from a table & stores them in 2 variables fname & lname. When displaying the jsp file on a browser, it shows the correct values "GRAY DAVIDSON".
When I use the same variables in an xml file & try to display it in the browser using an xsl stylesheet, it displays the variables directly (fname/lname) instead of the values in it(GRAY DAVIDSON). I am invoking this xml file thru' a link in the jsp file.
Can anyone please help me here & let me know what is the best way to do it using java?
*) sample.jsp :-
<!-- HTML CODE -->
<!-- JSP CODE TO RETRIEVE DATA FROM TABLES -->
out.println(fname);
out.println(lname);
<A HREF="test.xml">XML TEST PAGE</A>
<!-- HTML CODE GOES HERE -->
*)test.xml :-
<?xml version="1.0" encoding="UTF-8"?>
<?xml:stylesheet type="text/xsl" href="test.xsl">
<root>
<var1>fname</var1>
<var2>lname</var2>
</root>
*) test.xsl :-
<?xml version="1.0?>
<xsl:stylesheet xmlmn:xsl=" <xsl:templete match="/">
<HTML><HEAD></HEAD>
<BODY>
<xsl:for-each select="root">
<H1>
<xsl:value-of select="var1"/>
<xsl:value-of select="var2"/>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Thanks,
Sony
Here is a simple example explaining my problem.
I have a jsp file that retrieves data from a table & stores them in 2 variables fname & lname. When displaying the jsp file on a browser, it shows the correct values "GRAY DAVIDSON".
When I use the same variables in an xml file & try to display it in the browser using an xsl stylesheet, it displays the variables directly (fname/lname) instead of the values in it(GRAY DAVIDSON). I am invoking this xml file thru' a link in the jsp file.
Can anyone please help me here & let me know what is the best way to do it using java?
*) sample.jsp :-
<!-- HTML CODE -->
<!-- JSP CODE TO RETRIEVE DATA FROM TABLES -->
out.println(fname);
out.println(lname);
<A HREF="test.xml">XML TEST PAGE</A>
<!-- HTML CODE GOES HERE -->
*)test.xml :-
<?xml version="1.0" encoding="UTF-8"?>
<?xml:stylesheet type="text/xsl" href="test.xsl">
<root>
<var1>fname</var1>
<var2>lname</var2>
</root>
*) test.xsl :-
<?xml version="1.0?>
<xsl:stylesheet xmlmn:xsl=" <xsl:templete match="/">
<HTML><HEAD></HEAD>
<BODY>
<xsl:for-each select="root">
<H1>
<xsl:value-of select="var1"/>
<xsl:value-of select="var2"/>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Thanks,
Sony