Closed zhouhao27 closed 2 years ago
@zhouhao27 You can do it with 5.5.0
let str = """
<a>
<b>This is a test</b>
</a>
"""
// parse xml document
let xml = try! XML.parse(str)
xml.a.b.element?.text = "That is a test"
print(try! XML.Converter(xml).makeDocument(withDeclaration: false))
@kazuhiro4949 Wow, amazing. Tested. It's working. Thanks.
For example:
What should I do to replace the text
This is a test
? Thanks.