• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

issue creating an element

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to create a simple element in the way of <tag>value</tag> I have tried to crate it in a few ways, creating a document and then an element, reading the content from a string and nothing worked because all the time I try to create the element I always have the xml header in front of it, so this is how it looks my element when I print it.

and I only need this

because I need an array of Elements to pass it to my web service client to add them as headers on the soap message.
Of course, when I pass the array with those elements with the header I always have an error because the element is not well formed due to the xml header.
I wonder whether if there is a way of only create an element that doesn't contain the xml header, i.e. just <tag>value</tag>
Thanks
 
Marshal
Posts: 28263
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why do you say you have a problem creating an element when your post shows that you have created the element successfully? Your problem is that you don't want the prolog to appear when you serialize the document. So you need to look at the code which serializes the document and change that.
 
Is this the real life? Is this just fantasy? Is this a tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic