[ create a new paste ] login | about

Link: http://codepad.org/6BNuhRt4    [ raw code | output | fork ]

PHP, pasted on Nov 5:
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
 $xmlstr = '<Request>'.
        '</Request>';


$sxe = new SimpleXMLElement($xmlstr);
$authentication = $sxe->addChild('Authentication');
$authentication->addChild('Version', '2.0');
$processid = $sxe->addChild('Process ID=importSale');
$importsale = $processid->addChild('importSale');
$importsale->addChild('SCRIPTCODE', '<![CDATA[SCRIPT001]]>');
$importsale->addChild('PRODID','<!CDATA[DNTMAN]]>');
echo $sxe->asXML();


Output:
1
2
<?xml version="1.0"?>
<Request><Authentication><Version>2.0</Version></Authentication><Process ID=importSale><importSale><SCRIPTCODE>&lt;![CDATA[SCRIPT001]]&gt;</SCRIPTCODE><PRODID>&lt;!CDATA[DNTMAN]]&gt;</PRODID></importSale></Process ID=importSale></Request>


Create a new paste based on this one


Comments: