I am stuck with DomDocument
This thing is working fine, no doubt -
$resource1->appendChild($dom->createAttribute('type'))
->appendChild($dom->createTextnode("webcontent"));
It is adding type="webcontent" to resource node
However when I am using this code its not adding it to it -
$resource1->appendChild($dom->createAttribute('adlcp:scormType'))
->appendChild($dom->createTextnode("sco"));
Expected to generate - adlcp:scormType="sco" <-- Not Working
However If I am creating
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <-- Working
Code -
$manifestNode->appendChild($dom->createAttribute('xmlns:xsi'))
->appendChild($dom->createTextNode("http://www.w3.org/2001/XMLSchema-instance"));
Let me know what I am doing wrong and how do I make it working
EDIT
Error -
XML Parsing Error: prefix not bound to a namespace
Googled same with the keyword - xml parsing error prefix not bound to a namespace php but not much help.