Php代码
- <?php
- $domain="DOMAIN";
- $username="USERNAME";
- $owner="OWNER";
- $template="TEMPLATE";
- $description="DESCRIPTION";
- $topics="TOPICS";
- $subject="SUBJECT";
- $xmlstr="<?xmlversion=\"1.0\"encoding=\"UTF-8\"?>\n
- <batchcommands>\n
- \n</batchcommands>";
- $xml=newSimpleXMLElement($xmlstr);
- $create=$xml->addchild('create');
- $mailing_list=$create->addchild('mailing_list');
- $mailing_list->addAttribute('domain',($domain));
- $mailing_list->addAttribute('username',($username));
- $mailing_list->addChild('owner',$owner);
- $mailing_list->addChild('template',$template);
- $mailing_list->addChild('description',$description);
- $mailing_list->addChild('topics',$topics);
- $mailing_list->addChild('subject',$subject);
- $xml->asXML("C:/create.xml");
- ?>
生成文件内容:
- <?xmlversion="1.0"encoding="UTF-8"?>
- <batchcommands>
- <create>
- <mailing_listdomain="DOMAIN"username="USERNAME">
- <owner>OWNER</owner>
- <template>TEMPLATE</template>
- <description>DESCRIPTION</description>
- <topics>TOPICS</topics>
- <subject>SUBJECT</subject>
- </mailing_list>
- </create>
- </batchcommands>