Subject: RE: [xsl] Bold Text From: Rene de Vries <RdVries@xxxxxxxxxxx> Date: Fri, 20 Jul 2001 15:29:00 +0200 |
Hi Hy Huynh, First you should rewrite your XSL to realy use templates. In this way you can do at every level what you want, including the <Emphasis>-thing: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="Table"> <table border="1"> <xsl:apply-templates select="Tgroup"/> </table> </xsl:template> <xsl:template match="Tgroup"> <th> <xsl:apply-templates select="Thead"/> </th> <td> <xsl:apply-templates select="Tbody"/> </td> </xsl:template> <xsl:template match="Thead"> <tr> <xsl:apply-templates select="Row"/> </tr> </xsl:template> <xsl:template match="Tbody"> <tr> <xsl:apply-templates select="Row"/> </tr> </xsl:template> <xsl:template match="Row"> <td> <xsl:apply-templates select="Entry"/> </td> </xsl:template> <xsl:template match="Entry"> <xsl:apply-templates select="Para"/> </xsl:template> <xsl:template match="Para"> <xsl:value-of select="text()"/> <xsl:apply-templates select="Emphasis"/> </xsl:template> <xsl:template match="Emphasis"> <b> <xsl:value-of select="text()"/> </b> </xsl:template> </xsl:stylesheet> Greetings Rene { @ @ } ^ \__/ "You don't need eyes to see, you need vision!" -----Oorspronkelijk bericht----- Van: Hy Huynh [SMTP:hvqh@xxxxxxxxxxx] Verzonden: vrijdag 20 juli 2001 14:28 Aan: XSL-List@xxxxxxxxxxxxxxxxxxxxxx Onderwerp: [xsl] Bold Text hi, this might be a simple question, but i havent figure it out yet.. i have the following XML-file: <Table Colsep="1" Frame="All" Rowsep="1"> <Tgroup Align="Left" Charoff="50"> <Thead> <Row Rowsep="1"> <Entry Colname="1" Change-bar="No"> <Para Change-bar="No"> Stage </Para> </Entry> <Entry Colname="2" Change-bar="No">Description</Entry> </Row> </Thead> <Tbody> <Row Rowsep="1"> <Entry Colname="1" Change-bar="No"> <Para Change-bar="No">20</Para> </Entry> <Entry Colname="2" Change-bar="No"> <Para Change-bar="No"> Bla Bla Bla </Para> </Entry> </Row> . . . <Row Rowsep="1"> <Entry Colname="1" Change-bar="No"> <Para Change-bar="No">22</Para> </Entry> <Entry Colname="2" Change-bar="No"> <Para Change-bar="No"> Bla Bla Bla <Emphasis Emph-type="Bold"> Bold Text </Emphasis> Bla Bla Bla <Emphasis Emph-type="Bold"> More Bold Text</Emphasis> </Para> </Entry> </Row> . . . My XSL file looks like this: <xsl:template match = "Table" mode = "Table" name = "Table"> <table> <tr> <td> <table> <xsl:for-each select="Tgroup/Thead/Row"> <tr> <xsl:for-each select="Entry"> <td> <b><xsl:value-of select="."/></b> </td> </xsl:for-each> </tr> </xsl:for-each> <xsl:for-each select="Tgroup/Tbody/Row"> <tr> <xsl:for-each select="Entry"> <td> <p> <xsl:value-of select="."/><br></br> <-- bold text here --> </p> </td> </xsl:for-each> </tr> </xsl:for-each> </table> </td> </tr> </table> </xsl:template> My question is: Whenever the tag <Emphasis> appear, i like the text inside the <Emphasis>-tags to be bold. Is it possible? any suggestions will be helpful.. sincerly hy huynh _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Bold Text, Lawrence Mielniczuk | Thread | [xsl] Count - Saxon & Xalan, mjyoungblut |
Re: [xsl] Count - Saxon & Xalan, David Carlisle | Date | Re: [xsl] whitespace, Michael Beddow |
Month |