Hello,
This is what I have:
Code XML:<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd"> <command> <create> <domain:create xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd"> <domain:name>asda33sd.pt</domain:name> <domain:period unit="y">1</domain:period> <domain:registrant>F-AA-140384-FCCN</domain:registrant> <domain:contact type="tech">JAAD-912064-FCCN</domain:contact> <domain:authInfo> <domain:pw/> </domain:authInfo> </domain:create> <ns><hostAttr><hostName/><hostAddr ip="v4"/></hostAttr></ns></create> <extension> <ptdomain:create xmlns:ptdomain="http://eppdev.dns.pt/schemas/ptdomain-1.0" xsi:schemaLocation="http://eppdev.dns.pt/schemas/ptdomain-1.0 ptdomain-1.0.xsd"> <ptdomain:legitimacy type="1"/><ptdomain:registration_basis type="6A"/><ptdomain:autoRenew>false</ptdomain:autoRenew></ptdomain:create> </extension> <clTRID>criacao-dominio-4c59446420c90</clTRID> </command> </epp>
This is what I should have:
Code XML:<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd"> <command> <create> <domain:create xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd"> <domain:name>asda33sd.pt</domain:name> <domain:period unit="y">1</domain:period> <domain:ns> <domain:hostAttr> <domain:hostName>ns3.dns.pt</domain:hostName> <domain:hostAddr ip="v4">193.136.192.6</domain:hostAddr> </domain:hostAttr> </domain:ns> <domain:registrant>F-AA-140384-FCCN</domain:registrant> <domain:contact type="tech">JAAD-912064-FCCN</domain:contact> <domain:authInfo> <domain:pw/> </domain:authInfo> </domain:create> <ns><hostAttr><hostName/><hostAddr ip="v4"/></hostAttr></ns></create> <extension> <ptdomain:create xmlns:ptdomain="http://eppdev.dns.pt/schemas/ptdomain-1.0" xsi:schemaLocation="http://eppdev.dns.pt/schemas/ptdomain-1.0 ptdomain-1.0.xsd"> <ptdomain:legitimacy type="1"/><ptdomain:registration_basis type="6A"/><ptdomain:autoRenew>false</ptdomain:autoRenew></ptdomain:create> </extension> <clTRID>criacao-dominio-4c59446420c90</clTRID> </command> </epp>
So, this:
Code XML:<domain:ns> <domain:hostAttr> <domain:hostName>ns3.dns.pt</domain:hostName> <domain:hostAddr ip="v4">193.136.192.6</domain:hostAddr> </domain:hostAttr> </domain:ns>
Should be placed after the
Code XML:<domain:period unit="y">1</domain:period>
I've tried to place it like this:
When I do it, I do get:PHP Code://load the xml "content-empty" file:
$xmlObj = simplexml_load_file('RepositorioXml/CreateDomain.xml');
$nsNode = $xmlObj->command->create->children(self::OBJ_URI_DOMAIN)->create->addChild('domain:ns');
$hostAttr = $nsNode->addChild('domain:hostAttr');
$hostName = $hostAttr->addChild('domain:hostName');
$hostAddr = $hostAttr->addChild('domain:hostAddr');
$hostAddr->addAttribute('ip', 'v4');
$hostName = $dominioVo->getNsNome();
$hostAddr = $dominioVo->getNsEndereco();
//... other xml elements filled...
$xmlString = $xmlObj->asXML();
Can I please, once again, (I'm feeling bad already) request your help please?Warning: SimpleXMLElement::addChild() [simplexmlelement.addchild]: Cannot add child. Parent is not a permanent member of the XML tree
Regards,
Marcio
ps- any of you know how to highlight a specific line or lines, on a code snipped, here on sitepoint forums?








Bookmarks