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

Date help - fetch dates for Mondays between xxx and yyy?
Does anyone know the best way to do this? I have two dates, say:

2010-01-26 and 2010-05-30

Simple AND question
Hello,

I've got following code:

Code: if(strpos($row[13],"http://")

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

need help in mysql_num_rows()
please tell me what i am doing wrong in this query. it displays this error

Code: Warning: mys

generating random codes
Hi guys n gals,

I have a requirement to generate 250,000 unique codes...

These codes a

column name cancatenation within PL/SQL
I have a PLSQL store procedure, and the following statement is part of a subquery
fname||lnam

How to validate from 2 possible answers
Hi

I hope somebody can help me with what will probably be really simple, I'm pulling my hair

max() problem
I have a while loop to get image names.
Code: $imagequery = mysql_query("SELECT * FROM ad_i

values in array being escaped
I would like to submit some values - back to the same form for checking before processing...

query based on 2 conditions
I want to select if the doc_type is either s OR f but this doesn't work:

Code: [Select]$query

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