simplexml


Add xml attribute documentname


I'm exporting orders to xml
I write in the header of XML
$xml = new SimpleXMLElement('<Document></Document>');
$xml->addAttribute('documentname','DCustomers');
$xml->addAttribute('xmlns','http://www.microarea.it/XTech/1.0.0/XMLSchema');
the xml result is
<?xml version="1.0"?>
<Document xmlns="http://www.microarea.it/XTech/1.0.0/XMLSchema" documentname="DCustomers">
but the tag is reversed i need documentname="DCustomers" tag before in this way
<?xml version="1.0"?>
<Document documentname="DCustomers" xmlns="http://www.microarea.it/XTech/1.0.0/XMLSchema">
how can i do? thanks a lot!

Related Links

SimpleXML Sigle Depth Element with Attribute in Inline List
Copying CDATA between 2 xml files
PHP 7 simpleXML fatal error
SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found
Add xml attribute documentname
Pick shortest route with simpleXML
SimpleXML extract text between two tags
XML Node outside parent item
SimpleXMLElement cannot get the output
SimpleXML changing parsed decimals
can't navigate SimpleXMLElement data
PHP SimpleXML Load File with Null elements
Iterating through and editing a SimpleXML object by reference in PHP
Simplexml Insert into sub element
warning: simplexml_load_file(): I/O warning : failed to load external entity drupal [closed]
What's wrong with this code? SimpleXMLElement [closed]

Categories

HOME
wso2-am
osgi
image-processing
smarty
homebrew
mean-stack
rsync
ckeditor
google-translate
gnupg
izpack
wheelnav.js
spring-tool-suite
commonmark
django-simple-history
workload-scheduler
opentracing
transformation
swiftlint
riot.js
intentfilter
numerical-methods
qhull
user-interaction
linkerd
maquette
log4js-node
dbclient
r-raster
iframe-resizer
contact-form
google-api-nodejs-client
sequential
hexo
serverside-rendering
code-search-engine
twitch
lumberjack
ws-security
hp-ux
nxlog
flashair
slick-3.0
thin
scorm
logfiles
pnotify
alphabet
dotnetzip
veracode
fancybox-2
mplayer
elgg
r-forge
google-cdn
watchconnectivity
android-textview
log4c
py2app
django-debug-toolbar
contact-list
holder.js
persist
qcustomplot
packagist
yaws
associative-array
rtbkit
ruby-2.2
remobjects
streambase
csquery
python-green
block-device
c3
gadt
winddk
project-planning
heisenbug
sgen
aqtime
django-nonrel
chronoforms
seed
spring-validator
pvrtc
unc
cisco-jtapi
online-compilation
netbeans-6.9
zpt
disclosure
radcombobox
yslow
firefox4
webkit.net
putchar

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App