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. XPath syntax to find all nodes that don't have some attribute at all? [modified]

XPath syntax to find all nodes that don't have some attribute at all? [modified]

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

    Excuse me for this quick noob question. Let's say I have XML: <a name="a1">text</a> <a>text 2</a> <a name="a3">text 3</a> What's the XPath syntax to locate that secon "a" element that doen't have the "name" attribute? -- modified at 12:42 Tuesday 1st August, 2006

    D 1 Reply Last reply
    0
    • C CherezZaboro

      Excuse me for this quick noob question. Let's say I have XML: <a name="a1">text</a> <a>text 2</a> <a name="a3">text 3</a> What's the XPath syntax to locate that secon "a" element that doen't have the "name" attribute? -- modified at 12:42 Tuesday 1st August, 2006

      D Offline
      D Offline
      Dustin Metzgar
      wrote on last edited by
      #2

      Try this: a[not(boolean(@name))] That will give you everything that doesn't have a name attribute.


      Logifusion[^] If not entertaining, write your Congressman.

      C 1 Reply Last reply
      0
      • D Dustin Metzgar

        Try this: a[not(boolean(@name))] That will give you everything that doesn't have a name attribute.


        Logifusion[^] If not entertaining, write your Congressman.

        C Offline
        C Offline
        CherezZaboro
        wrote on last edited by
        #3

        Oh, that's great! Thanks a lot! Works!:-D

        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