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. Getting to xsl:template to match only nodes with a certain attribute

Getting to xsl:template to match only nodes with a certain attribute

Scheduled Pinned Locked Moved XML / XSL
javaphpcsswpfcom
3 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
    Taka Muraoka
    wrote on last edited by
    #1

    I have a rule that looks like this: <xsl:template match="item" > <item> <xsl:apply-templates /> </item> </xsl:template> This matches all <item> nodes in my source document. However, the source document contains <item xsi:type="ns:AAA"> and <item xsi:type="ns:BBB"> nodes. I want only the AAA nodes to be picked up. Any ideas...?


    "Sucks less" isn't progress - Kent Beck [^] Awasu 1.1 [^]: A free RSS reader with support for Code Project.

    M 1 Reply Last reply
    0
    • T Taka Muraoka

      I have a rule that looks like this: <xsl:template match="item" > <item> <xsl:apply-templates /> </item> </xsl:template> This matches all <item> nodes in my source document. However, the source document contains <item xsi:type="ns:AAA"> and <item xsi:type="ns:BBB"> nodes. I want only the AAA nodes to be picked up. Any ideas...?


      "Sucks less" isn't progress - Kent Beck [^] Awasu 1.1 [^]: A free RSS reader with support for Code Project.

      M Offline
      M Offline
      Mark Smithson
      wrote on last edited by
      #2

      Have you tried item[@xsi:type='ns:AAA'] as the match attribute?

      T 1 Reply Last reply
      0
      • M Mark Smithson

        Have you tried item[@xsi:type='ns:AAA'] as the match attribute?

        T Offline
        T Offline
        Taka Muraoka
        wrote on last edited by
        #3

        Worked like a charm! Thanks :-)


        "Sucks less" isn't progress - Kent Beck [^] Awasu 1.1 [^]: A free RSS reader with support for Code Project.

        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