Am trying to convert the following xml tag:
<MTag media="wifi">122</MTag>
to an equivalent type, but am not able to find any way from the provided examples to do it.
Have tried,
struct Profile: XMLIndexerDeserializable {
// some other elements...
let MTag: MTagElement
static func deserialize(_ node: XMLIndexer) throws -> Profile{
return try SMCPreferenceProfile(
updateInterval: node["MTag"].value()
)
}
}
and correspondingly,
struct MTagElement: XMLIndexerDeserializable {
let media: String
let value: Int
static func deserialize(_ node: XMLIndexer) throws -> MTagElement{
return try MTagElement(
media: node.value(ofAttribute: "media"),
value: node["MTag"].value()
)
}
}
which is anyways wrong. What is the way to convert the following tag to its equivalent custom type?