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

get multiple rows
Hi I want to get multiple rows from a db

I am using this for the db query
Code: public

Why does first ever HttpSendRequest take longer?
I promise this isn't as simple as it sounds. I'm wondering why the the first ever call to HttpSendRe

A little help in c#
i am doing a simple paint program using c# i want to draw with the mouse so i wrote the code of the

read integers that returns a negative or prints the average
Im trying to finish this homework assignment by tommarow afternoon and I keep getting stuck.
Wr

Prevent PHP mail( ) from appending hostname to from address
Hey guys,

I want to be able to send texts to phones via email (since each phone has their own

Reditecting pages based on logic
Newbie here, apologies in advance!

I am trying to use the header function to forward one of a

count only commas outside parenteses
I have a sql table containing
id - query - query name
the first page contains a drop down men

Uploading files/images via forms
Hey all, I am building a database for work that will contain some minor data on plant species along

Get last modified date of web page
Hai All,

In php how can i get last modified date of a give web page . I have tried to g

displaying unknown amount of results
I am reading a directory and getting a list of folders in the directory, I want to display the folde

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