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 Expression and Iterations

Xpath Expression and Iterations

Scheduled Pinned Locked Moved XML / XSL
debuggingxmlhelpquestion
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.
  • G Offline
    G Offline
    Giri K
    wrote on last edited by
    #1

    hi iam new to the Xpath could anyone help me?? i just want to pick up countryname which is element and it has a attribute for the code. i want to pick these values from the XmlDoc the code here as follows:- Dim CountryPropExpr As XPath.XPathExpression = Nav.Compile("./CountryName[@Code=""]") Dim CountryPropIter As XPath.XPathNodeIterator = Nav.Select(CountryPropExpr) If CountryPropIter IsNot Nothing AndAlso CountryPropIter.Count > 0 Then Try Dim CountryNameCode As String = getNodeValue(CountryPropIter.Current.SelectSingleNode("./CountryName[@Code=""]")) For Each CountryNameCode In CountryPropIter CountryNameCode = CountryPropIter.Current.Value Next Builder.AppendLine("") Catch ex As Exception Debug.Write(ex.Message) End Try End If when i compile it didn't pickup the values. Thanks Heaps in Advance

    M 1 Reply Last reply
    0
    • G Giri K

      hi iam new to the Xpath could anyone help me?? i just want to pick up countryname which is element and it has a attribute for the code. i want to pick these values from the XmlDoc the code here as follows:- Dim CountryPropExpr As XPath.XPathExpression = Nav.Compile("./CountryName[@Code=""]") Dim CountryPropIter As XPath.XPathNodeIterator = Nav.Select(CountryPropExpr) If CountryPropIter IsNot Nothing AndAlso CountryPropIter.Count > 0 Then Try Dim CountryNameCode As String = getNodeValue(CountryPropIter.Current.SelectSingleNode("./CountryName[@Code=""]")) For Each CountryNameCode In CountryPropIter CountryNameCode = CountryPropIter.Current.Value Next Builder.AppendLine("") Catch ex As Exception Debug.Write(ex.Message) End Try End If when i compile it didn't pickup the values. Thanks Heaps in Advance

      M Offline
      M Offline
      Mike DiRenzo
      wrote on last edited by
      #2

      Please provide a document fragment. Without the XML, there is noway to test the validity of your method call.

      "In quiet and silence, the truth is made clear."

      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