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

  • Home
  • SEARCH
  • 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 8939947
In Process

The Archive Base Latest Questions

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

Attached are two screen shots, and my code. I am trying to get the

  • 0

Attached are two screen shots, and my code. I am trying to get the animation_sequence as a closing and ending bracket, I’ve tried my best but now I seek your help. Here is my attempt, I decided to do this, but now my state, as in “Yahoo” appears as “Yahoo “, I know it might have to do with the setTextContent of animation sequence(although I don’t understand how that can add spaces to my state content. My problem here is that all I wanted was my animation sequence to have closing and ending brackets. I resolved by looking for two extra spaces in my if statement, but I feel like that’s a pathetic approach, and its kind of like accepting defeat.
The second image I attached, is what I wish to achieve, without adding extra ” ” to my state. Without my code below(the set text content part in specific)it produces image one. Just when I thought I solved it, these two spaces are killing me. If you need any extra code, please let me know. I need your help.

Element animationState = testDoc.createElement("animation_state");
        Element sequence = testDoc.createElement("animation_sequence");
        sequence.setTextContent(" ");
        sequence.appendChild(testDoc.createTextNode(" "));
testDoc.getElementsByTagName("animations_list").item(0).appendChild(animationState).appendChild(state);
        testDoc.getElementsByTagName("animation_state").item(testDoc.getElementsByTagName("state").getLength() - 1).appendChild(sequence);


   for(int i = 0; i<testDoc.getElementsByTagName("animation_state").getLength(); i++)
   {
       if(  testDoc.getElementsByTagName("animation_state").item(i).getTextContent().
            equals(Poseur.getPoseur().getAnimatedSpriteViewer().getSpriteStateComboBox().
            getSelectedItem().toString())||(testDoc.getElementsByTagName("animation_state").item(i).getTextContent()).equals(Poseur.getPoseur().getAnimatedSpriteViewer().getSpriteStateComboBox().getSelectedItem().toString()+"  "))
       {
           testDoc.getElementsByTagName("animation_sequence").item(i).appendChild(poseImage);
       }
   }

not good
good

  • 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-15T10:55:53+00:00Added an answer on June 15, 2026 at 10:55 am

    At the point you are creating the animation_sequence node, in Java it appears, you are working in an abstract tree structure. At this point, there’s no such thing as opening or closing tags, just nodes.

    The existence of “tags” (opening and closing) at all is a facet of the XML document’s serialization, i.e. how it is converted into a textual form for output. As far as the standard goes, the serialization <animation_sequence/> is indistinguishable from <animation_sequence></animation_sequence>, so a serializer is allowed to write either one.

    Some serializers will allow you to specify how you want empty nodes written out, either in shorthand form (trailing /) or as opening/closing tag pairs. You will need to research your particular XML library and determine if the serializer provides such an option.

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

Sidebar

Related Questions

Attached are two screen shots, and my code. I am trying to get the
I have an interface that has two toolbars, one attached to the frame and
I have an EC2 small instance, which has two EBS volumes attached and has
In the attached screen shot you can she that to rename a selected tab
Firebug shows some requests in Gray(screenshot attached and marked in Red) with status code
I have layout with two forms. I'm using scroller but scrollbars don't align to
I got a strange problem. You can see the two attached screenshots. The problem
I was looking of border between two ListViews as shown in the attached screenshot(in
The AutomationProperties.AutomationId attached property seems to have two purposes: Identifying UI controls during automated
I've got two models: Message and Attachment. Each attachment is attached to a specific

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.