May 22, 2003 #1 JRobins1 Programmer Joined May 22, 2003 Messages 1 Location CA I am trying to change the alignment of a <td> tag based on XML data: <page> <item> <text>Hello World</text> <align>right</align> <item> </page> but I dont know how to do it. Is there a way to do this using CSS or scripting??
I am trying to change the alignment of a <td> tag based on XML data: <page> <item> <text>Hello World</text> <align>right</align> <item> </page> but I dont know how to do it. Is there a way to do this using CSS or scripting??
May 22, 2003 #2 jel Programmer Joined Feb 17, 2002 Messages 349 Location NL Use <xsl:attribute> For example: Code: <xsl:template match="text"> <td> <xsl:attribute name="align"> <xsl:value-of select="../align"/> </xsl:attribute> <xsl:value-of select="."/> </td> </xsl:template> or: Code: <xsl:template match="item"> <td> <xsl:attribute name="align"> <xsl:value-of select="align"/> </xsl:attribute> <xsl:value-of select="text"/> </td>B </xsl:template> Upvote 0 Downvote
Use <xsl:attribute> For example: Code: <xsl:template match="text"> <td> <xsl:attribute name="align"> <xsl:value-of select="../align"/> </xsl:attribute> <xsl:value-of select="."/> </td> </xsl:template> or: Code: <xsl:template match="item"> <td> <xsl:attribute name="align"> <xsl:value-of select="align"/> </xsl:attribute> <xsl:value-of select="text"/> </td>B </xsl:template>