Creating XML with php


Posted on 16th Feb 2014 07:03 pm by admin

I need to creat an XML with php and have successfully produced a valid output.
The problem I have is that the XML requirements of the application that will import the XML requires that the XML file includes the line:

"<OpenShipments xmlns="x-schema:D:/Documents and Settings/VBN5CGC/My Documents/Trainings/xml autoimport WS/pruebas/OpenShipments.xdr">"

How do I include this line in my output XML file???

here is what I have so far

Code:

$doc = new DOMDocument('1.0');
$doc->formatOutput = true;

$root = $doc->createElement('OpenShipments');
$root = $doc->appendChild($root);

$occ = $doc->createElement('OpenShipment');
$occ = $root->appendChild($occ);

$oc2 = $doc->createElement('ShipTo');
$oc2 = $occ->appendChild($oc2);

Output:

<OpenShipments>
<OpenShipment>
<ShipTo>
</ShipTo>
</OpenShipment>
</OpenShipments>

The requied output is:

<OpenShipments xmlns="x-schema:D:/Documents and Settings/VBN5CGC/My Documents/Trainings/xml autoimport WS/pruebas/OpenShipments.xdr">
<OpenShipment>
<ShipTo>
</ShipTo>
</OpenShipment>
</OpenShipments>

No comments posted yet

Your Answer:

Login to answer
158 Like 16 Dislike
Previous forums Next forums
Other forums

Using loop to count number of entries
I'm writing a program that must ask user to type in numbers. After each entry, the program has to re

Unable to customise toolbar in FCK
Windows 7
Windows 7 default user account control worries experts. Corporate IT departments should be pleased w

Record count of entire database
Does anyone know if there is a way to obtain the number of records in each table of the database usi

Need help with some php code :)
Hey! I'm quite new to this whole thing, so please don't fire me with shait on this one =D

I'm

I would like "for" to wait 5 sec
I would like my 'for' loop to wait 5 sec before second iteration.


for ($i=0; $i<10

Two warning messages
Quote<b>Warning</b>: mysql_real_escape_string() expects parameter 1 to

Request.UrlReferrer
I need to make it so that a page can only be loaded when a button is clicked on a specific page. I d

how to get different value in second view of webdynpro?
hello guys,

In ABAP webdynpro I am trying to create one application having two views.

change text color with a jQuery code
Hihow can I change the text in a asp:TextBox to a different color when I start typing using jQuery?I

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash