Fix issue with hex string to integer conversion

Not able to PATCH few attributes in BiosAttributeRegistry,
evaluation of depex expression is getting failed, so attributes
which are not patchable are also added to Base Table.

Changes made to pass evaluation of depex expression.

Tested:
1. Enable "BMC remote setup" in EDKII Menu from Bios and set
   User Admin Password.
2. Perform Reset Bios or DC Cycle or AC cycle.
3. Wait for 120 seconds after complete bios boot up and check
   for bios.xml file in /var/oob folder.
4. Get - /redfish/v1/Registries/BiosAttributeRegistry
         /BiosAttributeRegistry
Response: All patchable attributes are displayed.
5. Select random attribute and
   Patch - /redfish/v1/Systems/system/Bios/Settings
Body:
{
    "data": {
        "Ioe0PcieRootPortEn_5": "0x0"
}}
6. Repeat steps 2, 3 and 4
Response:
{
    "@odata.id": "/redfish/v1/Registries/BiosAttributeRegistry
                  /BiosAttributeRegistry",
    "@odata.type": "#AttributeRegistry.v1_3_2.AttributeRegistry",
    "Id": "BiosAttributeRegistry",
    "Language": "en",
    "Name": "Bios Attribute Registry",
    "OwningEntity": "OpenBMC",
    "RegistryEntries": {
        "Attributes": [
            {
                "AttributeName": "Ioe0PcieRootPortEn_5",
                "CurrentValue": "0x00",
                "DefaultValue": "0x01",
                "DisplayName": "Ioe0PcieRootPortEn_5",
                "HelpText": "Control the PCI Express Root Port.",
                "MenuPath": "./",
                "ReadOnly": false,
                "Type": "String",
                "Value": [
                    {
                        "OneOf": "0x0"
                    },
                    {
                        "OneOf": "0x1"
                    }
                ]
            },.....
]
}
}

Signed-off-by: Snehalatha Venkatesh <snehalathax.v@intel.com>
Change-Id: I48e850758c0b9873c5f6645151e613dd0d0a7b39
diff --git a/include/biosxml.hpp b/include/biosxml.hpp
index cfe555b..214122d 100644
--- a/include/biosxml.hpp
+++ b/include/biosxml.hpp
@@ -785,18 +785,20 @@
 
             nameStr = pKnob->Attribute("name");
             currentValStr = pKnob->Attribute("CurrentVal");
-
-            try
+            std::stringstream ss;
+            ss << std::hex << currentValStr;
+            if (ss.good())
             {
-                currentVal = std::stoi(currentValStr);
+                ss >> currentVal;
             }
-            catch (const std::exception& ex)
+            else
             {
+                std::string error = "Invalid hex value input " + currentValStr +
+                                    " for " + nameStr + "\n";
                 phosphor::logging::log<phosphor::logging::level::ERR>(
-                    ex.what());
+                    error.c_str());
                 return;
             }
-
             if (pKnob->Attribute("description"))
                 descriptionStr = pKnob->Attribute("description");