This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XMLBeans is returning null on complex elements

 
Nathan England
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to use XMLBeans to parse an xml document. I have everything working up to a certain point.


The above code works fine, it parses with no errors, and prints the XML contents in its entirety. My problem, is that when I try to access the complex objects underneath the root element, the xmlbeans code is returning null. I have no error, or indication of any problem that could be occurring.

<root>
<ComplexType>
<simpleElement1>someText1</simpleElement1>
<ComplexType2>
<simpleElement2><someText2</simpleElement2>
...and so on

Why would I be able to do a requestObj.getComplexType().getSimpleElement1()
but
the ..getComplexType2() returns a null object?

Any ideas?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic