spelltwister Posted November 26, 2006 Share Posted November 26, 2006 Hey all,This is a sort of specific question, but hopefully someone knows ;-DI'm using minixml to parse an xml file. Here's the code:$XMLString = $_POST['xml_stuff'];$XMLDoc = new MiniXMLDoc();$XMLDoc->fromString($XMLString);$XMLRoot =& $XMLDoc->getRoot();Now, if I write echo $XMLDoc->toString(); it takes the following xml:<units> <info attacker="persian" turn="2" /> <g> <calvary ranged="0" number="2" bonus="0" /> </g></units>and transforms it into:<units> <info /> <g> <calvary /> </g></units> However, I had origianlly tested the script with the XML file sitting on the server and using the fromFile and toString and that worked fine. Any ideas why it's removing all the attributes from the XML?Thanks,Mike Link to comment https://forums.phpfreaks.com/topic/28542-minixml-problem/ Share on other sites More sharing options...
spelltwister Posted November 26, 2006 Author Share Posted November 26, 2006 Maybe I could be more clear. The posted data looks like:<units><info attacker="persian" turn="2" /><g><calvary ranged="0" number="2" bonus="0" /></g></units>and if I use $XMLDoc->toString(); is prints<units> <info /> <g> <calvary /> </g></units> Again, this worked fine when reading the EXACT same xml from a file then performing the operations on it.If no one knows, can someone please give me another method of parsing posted XML data?Thanks,Mike Link to comment https://forums.phpfreaks.com/topic/28542-minixml-problem/#findComment-130676 Share on other sites More sharing options...
spelltwister Posted November 27, 2006 Author Share Posted November 27, 2006 well, if i first force the posted data into the database, then retreive it, it works... any clues? Link to comment https://forums.phpfreaks.com/topic/28542-minixml-problem/#findComment-130736 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.