my dog learned polymorphism*
The moose likes JSP and the fly likes Percentage Calculation during XML import Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Percentage Calculation during XML import" Watch "Percentage Calculation during XML import" New topic
Author

Percentage Calculation during XML import

Gary Sheldon
Ranch Hand

Joined: Nov 21, 2011
Posts: 44
Hope someone can please help, I have a import process that parses an XML file and populates a database. The lines below simply read the relevant xml line and populate the test table and priceRrp field which is a decimal (10,2) with the appropriate data.

test.put("priceRrp", Subtotal3.item(i).getFirstChild().getNodeValue());
test.save();

I have however another field priceRrpVat again decimal (10,2) which I would like to carry out 10% reduction of the value Subtotal3.item(i).getFirstChild().getNodeValue() and store that in the field priceRrpVat. The problem is that the value is a string, so I need to convert the string, but I have tried till I am blue in the face but no joy.

Can someone can please help?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Percentage Calculation during XML import
 
Similar Threads
want to replace a value in XML tag
XML Node Parsing Problem , when Node owns NodeList using Xercer , HELP !!!!
servlets and xml
Help parse using JAXP
dom (getNodeValue)