Swift 生成 XML 内容 ECoXiS

码农软件 · 软件分类 · XML相关工具 · 2019-09-17 19:14:23

软件介绍

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()

本文地址:https://codercto.com/soft/d/14817.html

HTML5经典实例

HTML5经典实例

Christopher Schmitt、Kyle Simpson / 李强 / 中国电力出版社 / 2013-7 / 48.00元

《HTML5经典实例》对于从中级到高级的Web和移动Web开发者来说是绝佳之选,它帮助你选择对你有用的HTML5功能,并且帮助你体验其他的功能。个技巧的信息十分丰富,都包含了示例代码,并详细讨论了解决方案为何有效以及如何工作。一起来看看 《HTML5经典实例》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

MD5 加密
MD5 加密

MD5 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换