Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XML Bold and text colour code

    Hi I have an xml file that I have downloaded and would like the text that says new release 2013 to be bold and text colour red
    Can anyone help me please Many Thanks
    [ <artworkinfo>
    <albuminfo>
    <artLocation></artLocation>
    <artist>Sandie Shaw</artist>
    <albumName>Chante en francais / Pourvu que ca dure</albumName>
    <artistLink>New Release 2013</artistLink>
    <albumLink>http://www.sandieshaw.com/cds-4/</albumLink>
    </albuminfo>




    </artworkinfo>]

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,220
    Thanks
    23
    Thanked 606 Times in 605 Posts
    This is an xsl style sheet for your xml:
    Code:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
    <xsl:template match="/">
      <html>
      <body>
        <table border="1">
    	
          <tr bgcolor="#9acd32">
            <th>Artist</th>
            <th>Album Name</th>
            <th>Artist Link</th>
            <th>Album Link</th>
          </tr>
    <xsl:for-each select="artworkinfo/albuminfo">	  
    <tr>
            <td><xsl:value-of select="artist"/></td>
            <td><xsl:value-of select="albumName"/></td>
            <td style="font-weight:bold;color:red;"><xsl:value-of select="artistLink"/></td>
            <td><xsl:value-of select="albumLink"/></td>
    </tr>
    </xsl:for-each>
        </table>
      </body>
      </html>
    </xsl:template>
    </xsl:stylesheet>
    Don't forget to link them by putting <?xml-stylesheet type="text/xsl" href="test.xsl"?> in the xml file

  • #3
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sunfighter
    Thank you so much I really appreciate your help Regards


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •