aspose file tools
The moose likes Java in General and the fly likes Appending an int to an Element Node Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Appending an int to an Element Node" Watch "Appending an int to an Element Node" New topic
Author

Appending an int to an Element Node

Varalakshmi Ramanarayan
Ranch Hand

Joined: Oct 28, 2007
Posts: 108
Hi

Is it possible to insert an 'int' instead of a 'String' into the element node of the XML Document?
I am using the following code to insert text into the node. Currently I am coverting int into String using valueOf(..) and while reading back i'll have to convert String back to int. if possible I want to avoid this conversions. My code is below.

Please give me your feedback about this.
thanks.
[ March 22, 2008: Message edited by: Varalakshmi Ramanarayan ]

SCJP 5 - 87%<br />Next SCWCD
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16487
    
    2

No, you can only put text into an XML document. You will have to do those conversions. Fortunately they are extremely cheap and it's not worth worrying about.
Varalakshmi Ramanarayan
Ranch Hand

Joined: Oct 28, 2007
Posts: 108
Thanks for your reply Paul

regards,
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Appending an int to an Element Node
 
Similar Threads
generating XML document using Java
problem in modification of the value in xml file
Problem in creating XML using DOM
Appending data to existing XML file
Help regarding how to check the element entered is equal or not in xml file