ECoXiS 介绍
ECoXiS 可以让你在 Swift 语言中轻松创建 XML 内容。
示例代码:
func template(title: String, message: String) -> XMLDocument { let titleTextNode = <&title return XML( <"html" | ["lang": "en", "xmlns": "http://www.w3.org/1999/xhtml"] | [ <"head" | [<"title" | titleTextNode], <"body" | [ <"h1" | titleTextNode, <"p!" | <&message, <!"This is a comment, multiple --- are collapsed!--", PI("processing-instruction-target", "PI?> content") ] ], omitXMLDeclaration: true, doctype: Doctype() ) } //使用方法 template("<Foo Bar>", "Hello world!").toString()
ECoXiS 官网
https://github.com/IvIePhisto/ECoXiS
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。