• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How can I break XPath child node records

 
Ranch Hand
Posts: 851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,



Here is my code:


The output is very correct like this:
=======================================
Bogomolets National Medical University
Masters degree
June 2007
O.O. Bogomolets National Medical University
(MBBS)
June 2004
===============================================

I want to read ><University><Degree><Year> in three different variables to insert them in 3 different columns of the database but when am reading like:

then its output is showing 2 existing universities whereas I need two or all universities by iterating the records:
Bogomolets National Medical University
O.O. Bogomolets National Medical University

How can I read each university/degree/year in 3 different variables to insert each record in seprate columns of database?

Best regards
 
Farakh khan
Ranch Hand
Posts: 851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Can anybody help me?

Best regards
 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is 1 way I do:

1. I would use expression //EducationSplit to get a NodeList of EducationSplit
2. I loop thru a EducationSplit NodeList and for each Node
I would use expression University to get the value of University
I would use expression Degree to get the value of Degree
I would use expression Year to get the value of Year



 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>"//descendant::EducationSplit/*/text()"
This is akin to a monster. // is already a short-hand of descendant-or-self axis starting from the root. If it is meant for anything, it should be written as //EducationSplit/*/text().
 
Can you really tell me that we aren't dealing with suspicious baked goods? And then there is this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic