• Post Reply Bookmark Topic Watch Topic
  • New Topic

Appending an int to an Element Node  RSS feed

 
Varalakshmi Ramanarayan
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Paul Clapham
Sheriff
Posts: 22819
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Paul

regards,
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!