Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data is not properly export in the XML file

 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

Below give is the code i am getting the output in the XML file like.
Output
<?xml version="1.0" encoding="UTF-8" ?>
- <dataDelivery>
<employeeid>00000033</employeeid>
</dataDelivery>




Please suggest me in the above code how my xml file output should come like
<?xml version="1.0" encoding="UTF-8" ?>
- <dataDelivery>
<employeeid Length="10">00000033</employeeid>
</dataDelivery>

That means it should display like <employeeid its length value>00000033</employeeid>

Thanks in advance.
Sumanta Panda

 
Rob Spoor
Sheriff
Pie
Posts: 20605
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must add the length attribute to your Attributes object which you use in the startElement method call.
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Rob Prime,
Thanks for your suggestion.

I dont know the syntax how to add the length attribute to the Attributes object which i am use in the startElement method call.

Kindly help me for the needful.

Thanks for your time.

Regards,
Sumanta Panda
 
Rob Spoor
Sheriff
Pie
Posts: 20605
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
atts is an instance of AttributesImpl. Checks its API (click on the class name in this post) and check which methods it has. I'm sure you'll immediately see one you can use.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic