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 8358309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:45:15+00:00 2026-06-09T10:45:15+00:00

XML root Element has an id attribute with the value something like <Party id=PARTYID_1341592540748_ed044bd3-b8b2-40f9-a679-4daa411ecc45>

  • 0

XML root Element has an id attribute with the value something like

<Party id="PARTYID_1341592540748_ed044bd3-b8b2-40f9-a679-4daa411ecc45">

Here I need complete PartyId and a part of it in two different variables. I am trying to achieve it like this:

    @XmlAttribute
    protected String id;// complete partyId

    @XmlTransient
    @XmlAttribute(name="id")
    @XmlJavaTypeAdapter(PartyIdAdapter.class) //has logic to trim full party Id
    protected String partyId; //sub partyId

But I always get null for String partyId.

  • 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-09T10:45:17+00:00Added an answer on June 9, 2026 at 10:45 am

    I have finally achieved it with the help of third variable:

    @Id
        protected Long elementPK;
    
        protected String completeId;
    
        @XmlAttribute
        public void setId(String value)
        {
            this.completeId = value; 
            this.elementPK = Long.parseLong(value.split("_")[1]); 
        }
    

    If you can come up with an elegant solution then please let me know.

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

Sidebar

Related Questions

I've a XML structure like this: <root> <element> <name>Foo</name> <subelement> <key>1.1</key> <value>Lorem ipsum</value> </subelement>
I have a root element in my output xml document that has no attributes:
I need to read an xml element which has attribute xmlns=http://www.w3.org/2000/09/xmldsig#. XPathSelectElement is giving
I just want to select the target element which has name attribute value =
I have to create an XML document in C#. The root element has to
Given the following XML structure: <root> <data>x</data> <details> <some_other_element>...</some_other_element> <collection> <element><a>1</a></element> <element><a>2</a></element> <element><a>3</a></element> <collection>
Here is the XML outline: <Root> <Thing att=11> <Child lang=e> <record></record> <record></record> <record></record> </Child
Here is an example XML (case 1) : <root> <Item> <ItemID>4504216603</ItemID> <ListingDetails> <StartTime>10:00:10.000Z</StartTime> <EndTime>10:00:30.000Z</EndTime>
I have an xml document with a root element, two child elements, 'diagnostic' and
From the following XML input: <root> <node name=one value=1/> <node name=two value=2/> <node name=three

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.