• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Removing namespace prefixes from attributes

 
Martin Fiskare
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!

I need to export data using JAXB into XML. A 3rd party application, that needs to import the file can't handle namespace prefixes, no idea why but they keep insisting that there's no workaround possible on their side.

My question is now, is there any way to remove them prefixes from, most important, the root element, and if possible from the attributes of the subelements? See example below



Any suggestions are highly appreciated.

Thank you in advance.
 
Paul Clapham
Sheriff
Posts: 21114
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you considered the possibility that they can't process your document because it is not well-formed? It has namespace prefixes without a corresponding namespace declaration.

If the answer is that you posted an incomplete version of the document and your real document is well-formed, then I would suggest doing an XSL transformation to produce a similar document without namespaces.
 
Martin Fiskare
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, what i did in the first place was to run a namespace-filter, that removed the namepace attribute from the root element, resulting in every attibute of the sub-elements having a prefix 'ns1'.... and it's not well-formed anymore of course... DARN!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic