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 problem

XPATH problem

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

    Hi guys, I have a xml document as below and in Xslt I need to get the person name on the basis of email id as in below xml file , contributor node contain email id and associated name is included in Epic node can any body help me to get the name for each contributor through xpath? <ONIXMessage> <Product>    <Contributor>    <Email>Rohit@gmail.com</Email> </Contributor> </Product> <Product>    <Contributor>    <Email>Rohit@gmail.com</Email> </Contributor> </Product> <Epic> <Person>    <Name>Rohit</Name>    <Email>Rohit@gmail.com</Email> </Person> </Epic> </ONIXMessage>

    S 1 Reply Last reply
    0
    • R Rohit16db

      Hi guys, I have a xml document as below and in Xslt I need to get the person name on the basis of email id as in below xml file , contributor node contain email id and associated name is included in Epic node can any body help me to get the name for each contributor through xpath? <ONIXMessage> <Product>    <Contributor>    <Email>Rohit@gmail.com</Email> </Contributor> </Product> <Product>    <Contributor>    <Email>Rohit@gmail.com</Email> </Contributor> </Product> <Epic> <Person>    <Name>Rohit</Name>    <Email>Rohit@gmail.com</Email> </Person> </Epic> </ONIXMessage>

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      This XPath will get you the name of the first contributor:

      //Person[Email=//Contributor[1]/Email]/Name

      I don't think you can get all the names in one go with XPath.

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      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