Here's the XML I want to parse: http://www.wowarmory.com/character-sheet.xml?r=Nazjatar&n=Underdeath Code (markup): And here's how I'm trying to parse it: $xml = simplexml_load_file('http://www.wowarmory.com/character-sheet.xml?r=Nazjatar&n=Underdeath'); PHP: I get this error: ... parser error : StartTag: invalid element name in ... Code (markup): Any suggestions?
Try this to debug. $xml_file = file_get_contents('http://www.wowarmory.com/character-sheet.xml?r=Nazjatar&n=Underdeath'); echo "<pre>"; echo $xml_file; echo "</pre>"; //$xml = simplexml_load_string($xml_file); PHP: Look at the source and see if the xml is correctly formatted.
http://www.wowarmory.com/character-sheet.xml?r=Nazjatar&n=Underdeath is a web page xml file look like this http://megashare.info/_ads/book.xml
that's a xml and you're right. what I think about this that today people also make webpages in xml file and you can apply style with css in xml file. xml may be used for storing special data. xml is now there being used for showing web content. they might apply xsl etc.. you just need to study on this issuess...
Yes they are using xsl. I have already figured it out by the way, the problem was they are serving different content for different web browsers. I just needed to define a user agent as Firefox with cURL.