• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I break XPath child node records

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • 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: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Can anybody help me?

Best regards
 
H Paul
Ranch Hand
Posts: 471
4
  • Mark post as helpful
  • send pies
  • 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



 
g tsuji
Ranch Hand
Posts: 656
3
  • Mark post as helpful
  • send pies
  • 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().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic