I have a xml node to create like this :
<Document xmlns="blabla" xmlns:xsi="blablablabla" xsi:schemaLocation="blablablablablabla">
I did in my code several tests:
CASE 1
$document = $this->_xml;
$document->addAttribute('xmlns:xmlns', self::XMLNS);
$document->addAttribute("xmlns:xsi", self::XMLNS_XSI);
$document->addAttribute("xmlns:xsi:schemaLocation", self::XSI_SCHEMALOCATION);
which gives me :
<Document xmlns="blabla" xsi="blablablabla" xsi:schemaLocation="blablablablablabla">
So here all the xmln attributes are overriden by the xsi attribute.
CASE 2 When I add the prefix xmlns for last node :
$document = $this->_xml;
$document->addAttribute("xmlns:xsi", self::XMLNS_XSI, self::XMLNS);
$document->addAttribute("xmlns:xsi:schemaLocation", self::XSI_SCHEMALOCATION);
which gives me :
<Document xmlns:xmlns="blabla" xmlns:xsi="blablablabla" xsi:schemaLocation="blablablabla">
CASE 3 and when I try the easiest version it totally fails :
$document = $this->_xml;
$document->addAttribute('xmlns', self::XMLNS);
$document->addAttribute("xmlns:xsi", self::XMLNS_XSI);
$document->addAttribute("xmlns:xsi:schemaLocation", self::XSI_SCHEMALOCATION);
which gives me :
<Document xmlns:xmlns="blabla" xmlns="blabla" xmlns:xsi="blablablabla" xsi:schemaLocation="blablablablablabla">
How can I have all my 3 attributes xmlns, xmlns:xsi and xsi:schemaLocation correctly in my node?
Please note that I solved a first issue thanks to this post : Unable add namespace with PHPs SimpleXML
Thanks
I fixed it, it was well formatted with case 1, but firefox was badly interpreting the node.