aspose file tools
The moose likes XML and Related Technologies and the fly likes xmlns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xmlns" Watch "xmlns" New topic


ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 231
HI I am facing issue in generating xml
i want to generate xml like


so i have defined like this wile generating xml

<Book> with xmlns as "http:\\\book

means <book xmlns="http:\\\book">
it get output as
<book xmlns="http:\\\book">
<name xmlns="">richdadpoordad</>

see child element automatically adds blank xmlns ,

how to avoid that

Thanks ++


Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

What software are you using to generate the XML?

Not many get the right opportunity !
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 231
we are having domain specific API , have class jdom.Element
Paul Clapham

Joined: Oct 14, 2005
Posts: 19659

You declared the "book" element to be in the "http:\\\book" namespace. Now you have to decide what you want. Do you want the "name" element to be in that namespace, or do you want it to be in no namespace?

You should answer this question rather than deciding based on what the XML document looks like, because you are designing a data structure here. So, what's the answer to that question?
ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 231
got the issue .. need to add namespace to all child element .. xml file created successfully and also got imported into ms excel successfully

Ravi Rocks Again

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: xmlns
jQuery in Action, 3rd edition