XML added attribute version for states
This commit is contained in:
@@ -273,7 +273,18 @@ function BaseElement:fromXML(node, scope)
|
||||
if child.children then
|
||||
for _, stateChild in ipairs(child.children) do
|
||||
local propName = stateChild.tag
|
||||
local value = convertValue(stateChild.value, scope)
|
||||
local value
|
||||
|
||||
if stateChild.attributes and stateChild.attributes.value then
|
||||
value = convertValue(stateChild.attributes.value, scope)
|
||||
elseif stateChild.value then
|
||||
value = convertValue(stateChild.value, scope)
|
||||
else
|
||||
log.warn("XMLParser: State property '" .. propName .. "' has no value")
|
||||
value = nil
|
||||
end
|
||||
|
||||
if value ~= nil then
|
||||
local capitalizedName = propName:sub(1,1):upper() .. propName:sub(2)
|
||||
local methodName = "set"..capitalizedName.."State"
|
||||
|
||||
@@ -284,6 +295,7 @@ function BaseElement:fromXML(node, scope)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif(self._properties[child.tag])then
|
||||
if(self._properties[child.tag].type == "table")then
|
||||
self.set(child.tag, createTableFromNode(child, scope))
|
||||
|
||||
Reference in New Issue
Block a user