From 6c0154fb4e292ad22667e618f598a37cc5f9d524 Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 15 Jun 2006 18:18:47 +0000 Subject: Merge from 3.0 branch till 1166. --- framework/Xml/TXmlDocument.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'framework/Xml') diff --git a/framework/Xml/TXmlDocument.php b/framework/Xml/TXmlDocument.php index ab4b0b7a..0d766c68 100644 --- a/framework/Xml/TXmlDocument.php +++ b/framework/Xml/TXmlDocument.php @@ -229,6 +229,42 @@ class TXmlElement extends TComponent * You can also get the version and encoding of the XML document by * the Version and Encoding properties. * + * To construct an XML string, you may do the following: + * + * $doc=new TXmlDocument('1.0','utf-8'); + * $doc->TagName='Root'; + * + * $proc=new TXmlElement('Proc'); + * $proc->setAttribute('Name','xxxx'); + * $doc->Elements[]=$proc; + * + * $query=new TXmlElement('Query'); + * $query->setAttribute('ID','xxxx'); + * $proc->Elements[]=$query; + * + * $attr=new TXmlElement('Attr'); + * $attr->setAttribute('Name','aaa'); + * $attr->Value='1'; + * $query->Elements[]=$attr; + * + * $attr=new TXmlElement('Attr'); + * $attr->setAttribute('Name','bbb'); + * $attr->Value='1'; + * $query->Elements[]=$attr; + * + * The above code represents the following XML string: + * + * + * + * + * + * 1 + * 1 + * + * + * + * + * * @author Qiang Xue * @version $Revision: $ $Date: $ * @package System.Xml -- cgit v1.2.3