0

Using contentHandler I want to produce this xml

<?xml version="1.0" encoding="UTF-8"?>
<Account xmlns="http://example.com">
     <Id xmlns="">123</Id>
     <AccountNumber xmlns="">456</AccountNumber>
</Account>

How to write elements using contentHandler.startElement such that I'll get it with xmlns=""

Smern
  • 18,746
  • 21
  • 72
  • 90
bhar
  • 67
  • 2

1 Answers1

0

Assuming you are talking about SAX: documentation

You should use startPrefixMapping() with:

prefix - this should be an empty string in your case

uri - http://example.com

Community
  • 1
  • 1
S. Pauk
  • 5,208
  • 4
  • 31
  • 41