shantanu sharma

Greenhorn
+ Follow
since Jan 25, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by shantanu sharma

Hi Rajitha,
Sorry I took long time to reply..
Here is an XML that is working...the XSL is also there
This XSL paints alternate rows with defined colors..
-----------
XML
-----------
<?xml version="1.0" encoding="UTF-8"?>
<Transactions>
<Transaction>
<TransactionDate>10/02/1999</TransactionDate>
<TransactionDescription>Interest paid</TransactionDescription>
<Sequence>Transaction Sequence Number</Sequence>
<Amount>50.00</Amount>
<Balance>2000.00</Balance>
</Transaction>
<Transaction>
<TransactionDate>10/02/1999</TransactionDate>
<TransactionDescription>Interest paid</TransactionDescription>
<Sequence>Transaction Sequence Number</Sequence>
<Amount>50.00</Amount>
<Balance>2000.00</Balance>
</Transaction>
<Transaction>
<TransactionDate>10/02/1999</TransactionDate>
<TransactionDescription>Interest paid</TransactionDescription>
<Sequence>Transaction Sequence Number</Sequence>
<Amount>50.00</Amount>
<Balance>2000.00</Balance>
</Transaction>
<Transaction>
<TransactionDate>10/02/1999</TransactionDate>
<TransactionDescription>Interest paid</TransactionDescription>
<Sequence>Transaction Sequence Number</Sequence>
<Amount>50.00</Amount>
<Balance>2000.00</Balance>
</Transaction>
</Transactions>
--------------
XSL
--------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="Transactions">
<html>
<body>
<table>
<xsl:for-each select="./Transaction">
<tr>
<xsl:choose>
<xsl:when test="position() mod 2 = 0">
<xsl:attribute name="bgcolor">blue</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="bgcolor">yellow</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="./*">
<td>
<xsl:value-of select="."/>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
This XML prints the desired output.
Shantanu.
Hi Tualha,
There was some error on your XSL code...i have modified the XSL a little bit. Here is the code:
-----------------------------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<xsl:for-each select="mca/course_info">
<head>
<title>
<xsl:value-of select="./@title"/>
<!--A Student's Guide -->
</title>
</head>
<body>
<h1><!--Does this print-->
<xsl:value-of select="./@course_name"/>
</h1>
<!--And what about this-->
</body>
</xsl:for-each>
</html>
</xsl:template>
</xsl:stylesheet>
-----------------------------------------------------------------
I didn't know how you wanted the output, so i removed the errors the way i thought the output should be...
I hope this helps..
Shantanu
Hi Stephen,
Try http://www.xml101.com. Its a good place for starters.
Shantanu
Hi Rajitha,
As such there is no option that aligns the code but there is a way. Write or copy/paste the code in the editor window. Now to align the code, click on the "Enhanced Grid View" button and then click back on the "Text View" button. This should align the code automatically.
Shantanu
Hi,
I have an image which is stored in the Oracle Database.
I want to store this image in a Java variable(string) and then I want to pass this string(containing image) to XSLT stylesheet which will display that image(.gif or .jpg) in a browser.
How do i do it? Any help with a working example is appreciated.
Thanks.