This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

xml as byte array

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to this.

Is it possible to parse xml that is passed as byte[]?

Another question. Can I create a XML with DOM and then convert it to a byte array?

I want to create two methods. One that receives a byte array that represents xml. And, one method that converts xml to a byte array.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Karin Paola Illuminate:
Is it possible to parse xml that is passed as byte[]?


Yes. See ByteArrayToDocument on our FAQ server for example code.

Originally posted by Karin Paola Illuminate:
Another question. Can I create a XML with DOM and then convert it to a byte array?

Yes. See DocumentToByteArray on our FAQ server for example code.
 
Karin Paola Illuminate
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I use ByteArrayToDocument. Is it possible to parse the XML with SAX?
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Karin Paola Illuminate:
If I use ByteArrayToDocument. Is it possible to parse the XML with SAX?


Sure. You pass "new ByteArrayInputStream(myByteArray)" or "new InputSource(new ByteArrayInputStream(myByteArray))" to the parse() method of the SAXParser.
 
It's exactly the same and completely different as this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic