maxnz/xml-builder
最新稳定版本:v1.0.1
Composer 安装命令:
composer require maxnz/xml-builder
包简介
Build XML easily and concisely
关键字:
README 文档
README
Build XML in PHP easily and concisely.
Usage
A Single XML element
$xml = new XMLElement( qualifiedName: "elementName", value: "element value", ); print($xml->buildXML());
<elementName>element value</elementName>
Adding Attributes
$xml = new XMLElement( qualifiedName: "elementName", value: "element value", attributes: [ "attribute1" => "attribute 1 value", "attribute2" => "attribute 2 value", ], ); print($xml->buildXML());
<elementName attribute1="attribute 1 value" attribute2="attribute 2 value">element value</elementName>
Child Elements
$xml = new XMLElement( "elementName", "element value", [ "attribute1" => "attribute 1 value", "attribute2" => "attribute 2 value", ], [ new XMLElement( "child1", children: [ new XMLElement( "childOfChild", "valueOfChild", ) ] ), new XMLElement( "AnotherChild", "child2 Value", ), ], ); print($xml->buildXML());
<elementName attribute1="attribute 1 value" attribute2="attribute 2 value">element value<child1><childOfChild>valueOfChild</childOfChild></child1><AnotherChild>child2 Value</AnotherChild></elementName>
统计信息
- 总下载量: 138
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-05