Subject: [xsl] xsl:if From: tim <tim@xxxxxxxxxxx> Date: Fri, 01 Apr 2005 18:13:57 +0200 |
The XML looks like this ------------------------------------------------------ <npcs> <char> <id>28</id> <name>Bonrist</name> <location>Vanard</location> <charinfo>Shemtaa</charinfo> <prof/> <realprof>Thief</realprof> <localknown>0</localknown> <countryknown/> <gminfo>hello</gminfo> </char> - <char> <id>29</id> <name>Dynl</name> <location>Vanard</location> <charinfo>Elf</charinfo> <prof/> <realprof>Thief</realprof> <localknown>0</localknown> <countryknown/> <gminfo>hello</gminfo> </char> </npcs> --------------------------------------------------- The XSL I am using looks like this <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- root node--> <xsl:output method="html"/> <xsl:param name="id"/> <xsl:template match="/"> <html> <body> <h2>Character info</h2> <xsl:apply-templates /> </body> </html> </xsl:template>
<!-- into the npc node --> <xsl:template match="npcs"> <table width="75%" border="1">
<xsl:apply-templates> </xsl:apply-templates>
<xsl:template match="char"> <xsl:if test="$id=<xsl:value-of select="id" /> <tr> <td>Name :</td> <td colspan="3"><xsl:value-of select="name" /></td> </tr> <tr> <td>Known Profession :</td> <td><xsl:value-of select="prof" /></td> <td>Real Profession :</td> <td><xsl:value-of select="realprof" /></td> </tr> <tr> <td>Public Information :</td> <td colspan="3"><xsl:value-of select="charinfo" /></td> </tr> <tr> <td>Private Information :</td> <td colspan="3"><xsl:value-of select="$id" /></td> </tr> <tr> <td>Address Info :</td> <td rowspan="2"></td> <td>Local Fame Rating :</td> <td><xsl:value-of select="localknown" /></td> </tr> <tr> <td></td> <td>Country Fame Rating :</td> <td><xsl:value-of select="countryknown" /></td> </tr> </xsl:if> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] delete a node, omprakash . v | Thread | Re: [xsl] xsl:if, António Mota |
Re: [xsl] delete a node, omprakash . v | Date | RE: [xsl] providing intellisense us, Aron Bock |
Month |