Click here to Skip to main content
15,900,461 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: xml and xslt Pin
Kastellanos Nikos22-Sep-05 3:00
Kastellanos Nikos22-Sep-05 3:00 
QuestionXSLT not working Pin
Chetan Ranpariya21-Sep-05 19:37
Chetan Ranpariya21-Sep-05 19:37 
AnswerRe: XSLT not working Pin
Christian Graus27-Sep-05 3:55
protectorChristian Graus27-Sep-05 3:55 
QuestionHow to show a XML file as a table Pin
pmt20-Sep-05 20:30
pmt20-Sep-05 20:30 
AnswerRe: How to show a XML file as a table Pin
Sushant_Mathur26-Sep-05 23:01
Sushant_Mathur26-Sep-05 23:01 
GeneralRe: How to show a XML file as a table Pin
pmt26-Sep-05 23:10
pmt26-Sep-05 23:10 
GeneralRe: How to show a XML file as a table Pin
Sushant_Mathur27-Sep-05 0:44
Sushant_Mathur27-Sep-05 0:44 
AnswerRe: How to show a XML file as a table Pin
Sushant_Mathur2-Oct-05 20:10
Sushant_Mathur2-Oct-05 20:10 
Finally i have doneSmile | :) what u actually want
Let this is ur XML file in which u have defined row,col and border
<CARO_BOARD row="3" col="10" border="3">
<CHESS x="1" y="1" sign="X"/>
<CHESS x="1" y="2" sign="0"/>
<CHESS x="3" y="1" sign="X"/>
<CHESS x="4" y="4" sign="0"/>
</CARO_BOARD>
----------------------------------------
In this xsl we can use xsl:attribute-set to set attributes of table.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:attribute-set name="set_table">

<xsl:attribute name="border">
<xsl:variable name="chk_border" select="//@border" />
<xsl:value-of select="$chk_border"/>
</xsl:attribute>

<xsl:attribute name="cols">
<xsl:variable name="chk_cols" select="//@col" />
<xsl:value-of select="$chk_cols"/>
</xsl:attribute>

<xsl:attribute name="rows">
<xsl:variable name="chk_rows" select="//@row" />
<xsl:value-of select="$chk_rows"/>
</xsl:attribute>

</xsl:attribute-set>

<xsl:template match="/">
<html>
<body>
<table xsl:use-attribute-sets="set_table">
<xsl:for-each select="CARO_BOARD/CHESS">
<xsl:variable name="test_x" select="@x" />
<xsl:variable name="test_y" select="@y" />
<tr>
<xsl:if test="$test_x =1 and $test_y=1" >
<td><xsl:value-of select="@sign"/></td>
<td>NULL</td>
</xsl:if>
</tr>
<tr>
<xsl:if test="$test_x =1 and $test_y=2" >
<td>NULL</td>
<td><xsl:value-of select="@sign"/></td>
</xsl:if>
</tr>
<xsl:comment>You can include more if statements </xsl:comment>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>



please let me know if u have any further query.

-- modified at 2:47 Monday 3rd October, 2005
QuestionIs XSL still in? Pin
sameeraperera20-Sep-05 16:59
sameeraperera20-Sep-05 16:59 
QuestionWired xml parse??? Pin
Small Rat19-Sep-05 13:11
Small Rat19-Sep-05 13:11 
Questionhelp with xml and c++ Pin
gr8coaster32917-Sep-05 17:34
gr8coaster32917-Sep-05 17:34 
QuestionHow pass the value-of to a Javascript function? Pin
Melena16-Sep-05 6:25
Melena16-Sep-05 6:25 
AnswerRe: How pass the value-of to a Javascript function? Pin
Melena19-Sep-05 13:18
Melena19-Sep-05 13:18 
Questionproblem with conversion of excel to xml Pin
yeswanthtanamala16-Sep-05 0:40
yeswanthtanamala16-Sep-05 0:40 
QuestionSQL with XML Pin
Chetan Ranpariya14-Sep-05 23:13
Chetan Ranpariya14-Sep-05 23:13 
QuestionDisplaying DataGrid XML as HTML Pin
djt7314-Sep-05 19:25
djt7314-Sep-05 19:25 
QuestionProblem editing the SPThemes.xml File Pin
Andrew Porter13-Sep-05 4:26
Andrew Porter13-Sep-05 4:26 
AnswerRe: Problem editing the SPThemes.xml File Pin
Andrew Porter13-Sep-05 4:41
Andrew Porter13-Sep-05 4:41 
QuestionHow to create different IPC channels in both client and server configuration files Pin
SongDog12-Sep-05 19:22
SongDog12-Sep-05 19:22 
QuestionXML as input to a print engine. Pin
mcgahanfl12-Sep-05 5:42
mcgahanfl12-Sep-05 5:42 
QuestionLoad XML without root node Pin
10-Sep-05 21:06
suss10-Sep-05 21:06 
AnswerRe: Load XML without root node Pin
DavidNohejl11-Sep-05 1:28
DavidNohejl11-Sep-05 1:28 
Generalwhy U can't answer this Pin
logicaldna8-Sep-05 19:03
logicaldna8-Sep-05 19:03 
GeneralRe: why U can't answer this Pin
Christian Graus11-Sep-05 17:52
protectorChristian Graus11-Sep-05 17:52 
QuestionXML encryption Pin
Donnie138-Sep-05 10:59
Donnie138-Sep-05 10:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.