• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Name space recurring in each element of output XML

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am using jaxb to marshall object into xml and get the following as the output:
<ns1:tradeHeader xmlns:ns1="http://www.cognotec.com/trade/2004/v01">;
<ns1:instrument>SP</ns1:instrument>
<ns1:tradeDate>2006-04-27T00:00:00</ns1:tradeDate>
<ns1:acceptDate>2006-04-27T11:13:54</ns1:acceptDate>

My question is how do i avoid getting this namespace "ns1" in each element.
Above is a sample of the entire xml. i do add in the header the namespace to which the xml has to conform to.
pl help me
thanks
venkatB
 
Ranch Hand
Posts: 2107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That namespace is specified in your schema.

You want to generate an xml with totally no namespace anywhere?
 
venkat bagavathi subramanian
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes,
only an xml with no namespace.
thanks
venkatB
 
Jesus Angeles
Ranch Hand
Posts: 2107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(You can try remove the namespace declarations in the schema, and see if the marshalled xml is no longer namespace-qualified. It is probably the 'targetNamespace'.)

Can you post your schema here?
 
It's a tiny ad only because the water is so cold.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic