I am pulling data from an XML file that I don't control the format of. I want to place its data in a list of associations, with the end goal of producing a dataset. I was delighted to discover that this works...
xmlData =
XMLElement[
"Configuration", {"ActionPotentialBase" -> "0",
"FiringWeight" -> "1", "FiringThreshold" -> "5",
"GroupsPerModel" -> "5", "NeuronsPerGroup" -> "50",
"IntraGroupConnectionsPerNeuron" -> "5",
"ExtraGroupConnectionsPerGroup" -> "50",
"NeuralNetModelRunMethod" -> "Recursive"}, {}];
Apply[Association, xmlData[[2]]]
...returning an association in pretty much a single line of code.
The problem is, the XML file defines most of these values as strings, and I am going to use them downstream as integers. Is there some elegant way of casting them to integers quickly and easily, or am I forced to resort to something long-winded like...
<| "ActionPotentialBase" ->
ToExpression["ActionPotentialBase" /. xmlData[[2]]],
... and so on ..,
|>
Thanks in advance.
Brad