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. How to get the attribute name from xml using xslt

How to get the attribute name from xml using xslt

Scheduled Pinned Locked Moved XML / XSL
xmlhelptutorialquestionannouncement
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.
  • T Offline
    T Offline
    ThangamSundar
    wrote on last edited by
    #1

    Hai, i want to get the attribute names from the xml using xslt... my xml is: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?> <!-- Edited by XMLSpy® --> <catalog> <cd select="true"> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd select="true"> <title>Hide your heart</title> <artist>Bonnie Tyler</artist> <country>UK</country> <company>CBS Records</company> <price>9.90</price> <year>1988</year> </cd> </catalog> Now i want to get the value select equal to true or false.. Any one help me.... Regards, Subbu.H

    L 1 Reply Last reply
    0
    • T ThangamSundar

      Hai, i want to get the attribute names from the xml using xslt... my xml is: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?> <!-- Edited by XMLSpy® --> <catalog> <cd select="true"> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd select="true"> <title>Hide your heart</title> <artist>Bonnie Tyler</artist> <country>UK</country> <company>CBS Records</company> <price>9.90</price> <year>1988</year> </cd> </catalog> Now i want to get the value select equal to true or false.. Any one help me.... Regards, Subbu.H

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      H.Subbulakshmi wrote:

      i want to get the attribute names from the xml using xslt

      H.Subbulakshmi wrote:

      Now i want to get the value select equal to true or false..

      I don't know what that means but the following XSLT will render the names of all the attributes that have the value true

      <xsl:for-each select="//*/@*[.='true']">
        <p>
          <xsl:value-of select="name()"/>
        </p>
      </xsl:for-each>

      led mike

      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