aspose file tools*
The moose likes Java in General and the fly likes Data is not properly export in the XML file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Data is not properly export in the XML file" Watch "Data is not properly export in the XML file" New topic
Author

Data is not properly export in the XML file

sumanta panda
Ranch Hand

Joined: Jun 23, 2008
Posts: 224
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

Joined: Oct 27, 2005
Posts: 19720
    
  20

You must add the length attribute to your Attributes object which you use in the startElement method call.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
sumanta panda
Ranch Hand

Joined: Jun 23, 2008
Posts: 224
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

Joined: Oct 27, 2005
Posts: 19720
    
  20

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.
 
 
subject: Data is not properly export in the XML file