ballhogjoni Posted July 8, 2007 Share Posted July 8, 2007 Can anyone tell what is invalid about this php to xml code? <?php $doc = new_xmldoc('1.0'); $root = $doc->add_root('checkout-shopping-cart'); $shopping_cart = $root->new_child('shopping-cart',''); $items = $shopping_cart->new_child('items',''); $item = $items->new_child('item',''); $item->new_child('item-name','$5 off all Valentines Day Orders'); $item->new_child('item-description','Save $5 today only!'); $item->new_child('unit-price currency="USD"','-5.00'); $item->new_child('quantity','1'); $item = $items->new_child('item',''); $fp = @fopen('members.xml','w+'); if(!$fp) { die('Error cannot create XML file'); } fwrite($fp,$doc->dumpmem()); fclose($fp); ?> Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 8, 2007 Share Posted July 8, 2007 that is working tru class so how can we see the prob. just tell us whats the error Quote Link to comment Share on other sites More sharing options...
ballhogjoni Posted July 8, 2007 Author Share Posted July 8, 2007 O i figured our what the error is, how do you fix it? This is the xml file but the xml reader in the browser cannot publish it to the web page because of the closing tag on this line. The code in my last post closes the tag automatically with the same as the opening tag. <unit-price currency="USD">-5.00</unit-price currency="USD"> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.