Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    5
    Member #
    12446
    [highlight=xml]<xsl:template match="car">
    <xsl:for-each select="*">
    <ul><li>
    <xsl:value-of select="name()"/><xsl:text>: </xsl:text>
    <xsl:for-each select="@*">
    <xsl:if test="position()=last()">
    <xsl:value-of select="name()"/> = <xsl:value-of select="."/><xsl:text>.</xsl:text>
    </xsl:if>
    <xsl:if test="position()!=last()">
    <xsl:value-of select="name()"/> = <xsl:value-of select="."/><xsl:text>, </xsl:text>
    </xsl:if>
    </xsl:for-each>
    </li></ul>
    </xsl:for-each>[/highlight]
    That code above displays for example:
    • Ford: seats= 4, doors = 3.
    • Vauxhall:
    • Volkswagen: seats = 5, doors = 4.
    Is there anyway of using "if" or "match" in the above xsl, so i can say:
    "If car = volkswagen, display text as bold, italic and in red"?
    So then the above displays as this:
    • Ford: seats= 4, doors = 3.
    • Vauxhall.
    • Volkswagen: seats = 5, doors = 4.
    I tried mucking about with if, if match, if test but i couldn't get it to change the text any different.
    Any pointers or help would be great.

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:52 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com