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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:07:11+00:00 2026-06-07T15:07:11+00:00

So I am using DocumentBuilderFactory and DocumentBuilder to parse an xml. So it is

  • 0

So I am using DocumentBuilderFactory and DocumentBuilder to parse an xml.
So it is DOM parser.

But what I am trying to do is extract byte-array data (its an image encoded in base64)

Store it in one object and later in code write it out to another xml encoded in base64.

What is the best way to store this in btw.
Store it as string? or as ByteArray?

How can I extract byte array data in best way and write it out.

I am not experienced with this so wanted to get opinion from the group.

UPDATE: I am given XML I do not have control of incoming XML that comes in binary64 encoded

< byte-array >
  ... base64 encoded image ...
< /byte-array >

Using parser I have I need to store this node and question is should that be byte or string
and then writing it out to another node in new xml. again in base64 encoding.

thanks

  • 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-07T15:07:16+00:00Added an answer on June 7, 2026 at 3:07 pm

    The image should be stored in the first xml as a string. Perhaps something like this:

    <img src="data:image/gif;base64,sssssssssssss"/>
    

    If you need to write the same data to the second xml just use the same string which is already encoded. If you need to change the image. Get the attribute (element.getAttribute("src")), decode it with one of the many libraries (apache commons codec) and then reencode it as a string for the second xml.

    UPDATE RESPONSE:

    As to your update. Inside the <byte-array> element you should have plain text. It could be stored as text and then used as text in the second xml.

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

Sidebar

Related Questions

I'm trying to parse an xml file using XPath DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); domFactory.setNamespaceAware(true);
I am trying to use DOM Parser in Java to parse a small XML
SAXParseException is occuring while iam trying to parse an xml unsing dom parser here
I am using DOM parser and XPATH to parse a my XML file. I
I'm trying to parse a XML using Apache Commons JXPath. But for some reason,
I am trying to parse a dom element. Element element: <?xml version=1.0 encoding=UTF-8?> <feed
I'm trying to extract n0Y7ezLlIYA8R0K54rEmHaTOraBQVSPDjQaGlQxlGso4jdVN1kRxtcfskEs= using w3c dom <html> <div id='token' style='display:none;'> n0Y7ezLlIYA8R0K54rEmHaTOraBQVSPDjQaGlQxlGso4jdVN1kRxtcfskEs= </div>
I'm trying to parse a file from the web on Android using the DOM
I'm parsing an XML document into my own structure using DOM, but in another
I've just started using DOM and wanted to parse an Android XML layout file

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.