RE: [xsl] Indifferenct behavoiur For XSL transform

Subject: RE: [xsl] Indifferenct behavoiur For XSL transform
From: Hiren Shah <Hshah@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 25 Nov 2002 20:08:21 +0530
Hi Vasu,
         Thank for the reply.I am attaching you the html output I get and
where thing are going wrong.

html o/p file
<html><head>
		<META http-equiv="Content-Type" content="text/html;
charset=UTF-16">
		<title></title>
		<script>

				
		 </script>
		 </head>
		 <body>
		 <h1 align="center">Competitor Report</h1>
		<table border="0" width="75%" align="center">
		<tr><th bgcolor="red" align="left" colspan="2">Corporate
Info</th>Corporate Info
		<tr>
		<th bgcolor="silver" align="left">Company Financials</th>
		<th bgcolor="silver" align="left">Competitor1</th>
		</tr>
				<tr><th align="left">Gross Profit</th><td>9
Million USD</td>
				</tr>
				<tr><td></td>
				</tr>
				<tr><th align="left">Net Profit</th><td>9
Million USD </td>
				</tr>
				<tr><td></td>
				</tr>
		</tr>
		</table><div align="center">Page X of Y</div>
		<p /><div align="center">Copy right</div>
		<p /><br><hr><br><div id="PrintButton"
align="center"><dd><input type="button" name="print" value="Print"
></dd></div>
	</body></html>
I have made the value of the text bold.I dont know how this text is figuring
out Corporate Info is printed 2 times one inside my <th > tag and one out
side of <th ></th> tag .First one is proper but the one printing outside is
not required and cant figureout how its coming there .I tried Xml spy
debugger also but cant figureout whats wrong.
thank you,
Hiren Shah


-----Original Message-----
From: Vasu Chakkera [mailto:vasucv@xxxxxxxxxxx]
Sent: Monday, November 25, 2002 7:04 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Indifferenct behavoiur For XSL transform


Hi Hiren,
There are quite a lot of places which needs changes. Can you send the final
output file , mentioning, where you would like to see which data..
for example.
first column , first row has Report/Body/Rowset/Title. etc..
That would be easier..
Thanks
----- Original Message -----
From: "Hiren Shah" <Hshah@xxxxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, November 25, 2002 12:18 PM
Subject: [xsl] Indifferenct behavoiur For XSL transform


> Hi All,
>            I have indifferent behaviur for my Xml when I apply my xsl Xml
> format is as below .
> When I try to print Title Tag under <Body><RowSet><Title>......
> My value for Title gets printed under TD tag of html and also outside of
my
> TD tag of html table.I think if you will run this xml and xsl together and
> view the output you will come to know whats the problem.I hope anybody can
> help me to solve the problem .
> thanks ,
> Hiren Shah
>
> XML File CompetitorReport.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSPY v5 U (http://www.xmlspy.com) by Hiren Shah
(USI) -->
> <?xml-stylesheet type="text/xsl" href="CompetitorReport.xsl"?>
> <Report>
> <Header>
> <Row>
> <Column type="reportheader">Competitor
> Report</Column>
> <Column/>
> </Row>
> </Header>
> <Body>
> <RowSet>
> <Title>Corporate Info</Title>
> <RowSetBody>
> <RowSetHeader>
> <Column type="tableheader">Company
> Financials</Column>
> <Column
> type="tableheader">Competitor1</Column>
>
> </RowSetHeader>
> <Row>
> <Column type="rowheader">Gross
> Profit</Column>
> <Column type="data">9 Million
> USD</Column>
>
> </Row>
> <Row>
> <Column type="rowheader">Net
> Profit</Column>
> <Column type="data">9 Million USD
> </Column>
> </Row>
> </RowSetBody>
> </RowSet>
> </Body>
> <Footer>
> <Row>
> <Column type="footer">Page X of Y</Column>
> <Column>Copy right</Column>
> </Row>
> </Footer>
> </Report>
>
>
> and xsl file is as given below CompetitorReport.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="/">
> <html>
> <head>
> <title></title>
> </head>
> <body >
> <h1 align="center">
> <xsl:value-of
> select="//Header/Row/Column[@type]"/>
> </h1>
> <table border="0" width="75%"  align="center" >
> <xsl:apply-templates select="//RowSet" />
> </table>
> <xsl:apply-templates select="//Footer" /><br></br>
> <hr></hr><br></br>
> </body>
> </html>
> </xsl:template>
> <!--
>  This template applies formatting to the "item" elements.
>      All "item" elements get this formatting applied, because
>      "apply-templates" is called from the root template above.
>
>   -->
>   <xsl:template match="Footer">
> <xsl:for-each select="Row">
>
> <xsl:for-each select="Column">
>
> <div align="center"><xsl:value-of select="."/></div><p></p>
>
> </xsl:for-each>
> </xsl:for-each>
> </xsl:template>
>
> <xsl:template match="RowSet">
> <tr>
> <th  bgcolor="red"   align="left" >
> <xsl:attribute name="colspan" >
> <xsl:value-of
> select="count(//RowSetHeader/Column)"></xsl:value-of>
> </xsl:attribute>
>
> <xsl:value-of select="Title"
> disable-output-escaping="yes"></xsl:value-of></th>
> <xsl:apply-templates select="child::*"/>
>     </tr>
>
> </xsl:template>
>
> <xsl:template match="RowBody">
> <xsl:apply-templates select="/RowSetHeader"/>
> <xsl:apply-templates select="/Row"/>
> </xsl:template>
>
>
> <xsl:template match="RowSetHeader">
> <tr>
> <xsl:for-each select="Column">
> <th  bgcolor="silver"  align="left"><xsl:value-of select="."/></th>
> </xsl:for-each>
> </tr>
>     </xsl:template>
>     <xsl:template match="Row">
> <tr>
> <xsl:for-each select="Column">
> <xsl:choose>
>     <xsl:when
> test="normalize-space(@type)='rowheader' ">
> <th
> align="left"><xsl:value-of select="."/></th>
> </xsl:when>
> <xsl:otherwise>
>
> <td><xsl:value-of select="."/></td>
> </xsl:otherwise>
>    </xsl:choose>
> </xsl:for-each>
> </tr>
> <tr>
>           <td><xsl:text></xsl:text></td>
>     </tr>
>   </xsl:template>
>  </xsl:stylesheet>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread