Jump to content

FamilyGuy

Members
  • Posts

    5
  • Joined

  • Last visited

FamilyGuy's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Ok I have my XML doc which look like this <Row1><Number1>3</Number1><Number2>6</Number2><Number3>4</Number3><Number4>1</Number4><Number5>7</Number5><Number6>8</Number6><Number7 problem="yes">5</Number7><Number8 problem="yes">2</Number8><Number9>9</Number9></Row1> and my XSlt looks like this <?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/"><html><head> <!--The link for the CSS File--> <link rel="stylesheet" href="stylesheet.css" type="text/css"/> <title>Soduku Problem</title></head><body> <table width="100%" height="25%" cellspacing="0"> <tr><td colspan="2"><img src="Titlepic.jpg"/></td> </tr> <tr><td class="MainHeading" colspan="2">Navigation Menu</td></tr> <tr><td class="NavBar"><a href="Problem">Problem</a></td><td Class="NavBar"><a href="Solution">Solution</a></td></tr></table><br/><br/><xsl:apply-templates select="Sudoku"/> </body></html></xsl:template><!--Match template Sudoku, first level of SudokuSolut.xml--><xsl:template match="Sudoku"><table class="main" border="0" cellspacing="0" ><xsl:apply-templates select="Row1"/> <xsl:apply-templates select="Row2"/> <xsl:apply-templates select="Row3"/> <xsl:apply-templates select="Row4"/> <xsl:apply-templates select="Row5"/> <xsl:apply-templates select="Row6"/> <xsl:apply-templates select="Row7"/> <xsl:apply-templates select="Row8"/> <xsl:apply-templates select="Row9"/> </table></xsl:template><xsl:template match="Row1"><!--Only displays the Problem Numbers--> <table class="Row1" border="1" cellspacing="0" cellpadding="3"><tr> <xsl:if test="@problem='yes'"> <td><xsl:apply-templates select="Number1"/> </td> <td><xsl:apply-templates select="Number2"/> </td> <td><xsl:apply-templates select="Number3"/></td> <td><xsl:apply-templates select="Number4"/></td> <td><xsl:apply-templates select="Number5"/></td> <td><xsl:apply-templates select="Number6"/></td> <td><xsl:apply-templates select="Number7"/></td> <td><xsl:apply-templates select="Number8"/></td> <td><xsl:apply-templates select="Number9"/></td></xsl:if> </tr></table></xsl:template><xsl:template match="Row2"> <table class="Row1" border="1" cellspacing="0" cellpadding="3"> <tr> <td><xsl:apply-templates select="Number1"/></td> <td><xsl:apply-templates select="Number2"/></td> <td><xsl:apply-templates select="Number3"/></td> <td><xsl:apply-templates select="Number4"/></td> <td><xsl:apply-templates select="Number5"/></td> <td><xsl:apply-templates select="Number6"/></td> <td><xsl:apply-templates select="Number7"/></td> <td><xsl:apply-templates select="Number8"/></td> <td><xsl:apply-templates select="Number9"/></td> </tr></table></xsl:template> I want it so when i put <XSL: if test="problem=[.'yes']"> it only displays the problem numbers but it doesnt seem to work I have tried to place it in all different places but it either doesnt work or none of the number show not even the table border.
  2. Yes but I have Column ID 1-9 so if I use @ID how will it know which one out of 1-9?
  3. Ok i have an XML from <Column ID="1"> to <Column ID="9"> and I wish each column of my table to display thecorrect column ID how is this possible please
  4. FamilyGuy

    XML - DTD

    Would you or anybody be able to give any guidence of how to do this I have had a look at the sudoku problem but I do not understand how to create a seperae number in each cell
  5. FamilyGuy

    XML - DTD

    I have created a XML file, <?xml version="1.0"?><CW><Problem><Row id="1"><Letter>M</letter></Row><Row id="2"><Letter>M</letter></Row><Row id="3"><Letter>M</letter></Row><Row id="4"><Letter>M</letter></Row></Problem><Solution><Row id="1"><Letter>M</letter></Row><Row id="2"><Letter>M</letter></Row><Row id="3"><Letter>M</letter></Row><Row id="4"><Letter>M</letter></Row></Solution></CW> but when i create the DTD file will i have to define Letter and Row twice as they appear both in the Problem and in the Solution?Also i i have display the data on 2 different pages a problem and a solution page in a table can anybody give me any guidence on how to each letter into a different cel of a table?Any Advice would be greatly appreciated
×
×
  • Create New...