Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XSLT Question

XSLT Question

Scheduled Pinned Locked Moved XML / XSL
xmlhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dotnetquery
    wrote on last edited by
    #1

    I have a XML File of the format India Player 1 India Player 2 India Player 3 India Player 4 India Player 5 India Player 6 India Player 7 India Player 8 India Player 9 India Player 10 Pakistan Player 1 Pakistan Player 2 Pakistan Player 3 Pakistan Player 4 Pakistan Player 5 Pakistan Player 6 Pakistan Player 7 Pakistan Player 8 Pakistan Player 9 Pakistan Player 10 I want to print this file in a tabular format with the name of the country in te header and the name of the players as rows. That is in a tabular format. Below the name of the country there should be the name of the players. Can anyone help me.

    P 1 Reply Last reply
    0
    • D dotnetquery

      I have a XML File of the format India Player 1 India Player 2 India Player 3 India Player 4 India Player 5 India Player 6 India Player 7 India Player 8 India Player 9 India Player 10 Pakistan Player 1 Pakistan Player 2 Pakistan Player 3 Pakistan Player 4 Pakistan Player 5 Pakistan Player 6 Pakistan Player 7 Pakistan Player 8 Pakistan Player 9 Pakistan Player 10 I want to print this file in a tabular format with the name of the country in te header and the name of the players as rows. That is in a tabular format. Below the name of the country there should be the name of the players. Can anyone help me.

      P Offline
      P Offline
      Phil Hobgen
      wrote on last edited by
      #2

      Hi, This should get you started - it's not in a table, but you should get there from here<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/"> <html> <body> <h1>Cricket</h1> <xsl:apply-templates select="CRICKET/TEAM"/> </body> </html> </xsl:template> <xsl:template match="TEAM"> <h2><xsl:value-of select="@Name" /></h2> <xsl:apply-templates select="PLAYER"/> </xsl:template> <xsl:template match="PLAYER"> <h3><xsl:value-of select="." /></h3> </xsl:template> </xsl:stylesheet>
      Cheers Phil Hobgen barbari.co.uk Southampton, UK

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups