Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8943969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:55:04+00:00 2026-06-15T11:55:04+00:00

Ihave some issues trying to render the following xml code with JAXB2 annotations: ….

  • 0

Ihave some issues trying to render the following xml code with JAXB2 annotations:

....
<bizTransactionList>
    <bizTransaction type="urn:epcglobal:fmcg:btt:po">
        http://transaction.acme.com/po/54847
    </bizTransaction>
    <!--other entries -->
</bizTransactionList>
...

following the documentation I managed to solve the problem as follows:
1) inside the class which owns the list I annotate the list getter this way

@XmlElementWrapper(name="bizTransactionList")
@XmlElement(name="bizTransaction")
public List<BizTransaction> getBizTransactionList() {
    return bizTransactionList;
}

2) I create the BizTransaction class as follows

public class BizTransaction {

    private URI transactionId;
    private URI type;

    @XmlValue
    public URI getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(URI transactionId) {
        this.transactionId = transactionId;
    }

    @XmlAttribute
    public URI getType() {
        return type;
    }

    public void setType(URI type) {
        this.type = type;
    }

    public BizTransaction() {
        // TODO Auto-generated constructor stub
    }

    public BizTransaction(URI transactionId, URI type) {
        super();
        this.transactionId = transactionId;
        this.type = type;
    }

}

now the problem is that the attribute works fine, but the value (i.e. the transactionId variable) is always null.
Can you help me to spot the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:55:05+00:00Added an answer on June 15, 2026 at 11:55 am

    That’s a reasonable model but your example XML is not valid because the leading and trailing white space around the bizTransaction element value means it is not a valid URI. If you said

        <bizTransaction type="urn:foo">http://transaction.acme.com/po/54847</bizTransaction>
    

    then it would work as you expect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to correctly render some features I read from a featuretable of a
I am having some issues trying to get my automated builds to compile projects
Hi I am having some issues trying to get check box values. For a
I've been recently trying to create some 3D rendering code in Silverlight 5 with
So i have this rather strange issue, i am trying to line up some
I have some issues in setting the classpath for the a project for which
I have some issues with a PHP file that is not working properly. The
I have some issues with my EJB 3 timer where it is launched more
I am integrating PayPal in my website But I have some issues in it.
I ran git pull origin and now I have some issues with merge my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.