Closed Tulakshana closed 6 years ago
It sounds like what you're asking about is essentially an innerXML
type of property that would be the string format. Is that correct? It might make sense to call it innerDescription
or childrenDescription
just to stay consistent with the existing description
property, but I'm open to ideas.
Do you have any thoughts?
@drmohundro, Yes, you got it right. I'm looking at something like an innerXML type of property. For the moment my work around is as follows,
let body = xml['abody']
var html = ""
for child in body.children {
html += (child.element?.description ?? "")
}
@Tulakshana I just pushed #188 to add this feature... I'll plan on releasing it over the next few days, but if you'd like to check it out on my branch first to offer feedback, I'd welcome it! Thanks again for the suggestion!
FYI, I just published 4.7.0
to include this change.
Following is extracted from the xml I'm trying to serialized. I would like to retrieve the elements, attributes and text inside the element 'abody' in their textual format. What is the correct way to go about this?
I tried doing xml["abody"].element?.description. Then the string contains the 'abody' tag also. I only need its children.
Expected output,