• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Copying one node to another node

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends
Hi
I have around 100 xml files in which my developer by mistake inserted Some text in wrong node(element).
Now I wanna make java program in which I want to cut that text from that node and want to paste it in another node.
I have wrote some cod efor that but it is giving me exception in
specific code :
Exception is "java.lang.NullPointerException"
Code is :


Please let me where i'm going wrong .
Thanks
Preeti
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Preeti ,
Can you post the exact Exception i.e. print stack of the exception . That will help to solv this problem.
Cheers,
Paddy
 
Preeti Sikri
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The full exception is like this

java.lang.NullPointerException
at parser.grrText.swapNodes(grrText.java:112)
at parser.grrText.checkRpt(grrText.java:91)
at parser.grrText.fileToDom(grrText.java:66)
at parser.grrText.process(grrText.java:57)
at parser.grrText.<init>(grrText.java:40)
at parser.grrText.main(grrText.java:44)
Exception in thread "main"


Please help me.
Any help would be great.
Thanks.
 
It's just a flesh wound! Or a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic