• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help parse using JAXP

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Can someone help me out. I am trying to load xml into an object and it is giving me problems. The xml is as follows:
<companys>
<company>
<name>test company name</name>
</company>
<model>
<name>Conservative</name>
<max-percent>18</max-percent>
<min-percent>1</min-percent>
<class>
<name>Large Value</name>
<percent>5</percent>
</class>
<class>
<name>Large, Mid, Small Blend</name>
<percent>20</percent>
</class>
</model>
</companys>
I am trying to get the class name and percents into an object but I keep getting a null pointer exception. Here is the code:

If someone could help I would really appreciate it.
Thanks,
Trish
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic