I am running a website where some data are imported from other websites. So far it is working using XML files that are generated on the other side and read on my side.
One particular website doesn’t want to do that saying that creating XML files is “outdated and obsolete” adding that “the mode used is deprecated by PHP”.
This sound more likely. There are still plenty of uses for XML, so no reason for PHP to stop supporting its creation or reading.
I’m currently working on a personal project that creates KML and GPX files, both of which are XML based file with geo-location data. I’m using PHP’s SimpleXML extension for that, which is supported in versions 5, 7 and 8 of PHP. I also use it at work to create Ecommerece product feeds for Google Merchant Centre and Facebook Shops.
I guess the site may provide data in some other form, like JSON for exapmple. Can you find out what type of data they will supply?
Thanks for your answer. I just thought stating that generating XML files was “outdated and obsolete” a bit extreme. I know JSON is an alternative but I guess we’ll still see plenty of XML files being generated for a long time.
I haven’t asked other form of data but I will, we just need to find a common ground.
XML is often considered “bulky” in comparison to JSON, which is probably why it’s not as in-vogue.
I certainly think both have their places. XML can be better parsed by a human than most JSON, but JSON is snappier for communication between machines, particularly if the other end has a native JSON parser.
JSON is technically limited more in its’ data types, but the majority of times the data being transfered fits into one of JSON’s categories.
I don’t foresee XML being deprecated by PHP anytime soon, as it’s still a used format. Noone forces you to load XML, so its existance in the PHP engine doesn’t negatively affect the system.
No way is PHP going to deprecate XML. I mean think of APIs. One model of API is SOAP which is based on XML. There are a ton of SOAP services out there and for that fact alone PHP will need to support XML in the foreseeable future. Not only that, but there are still services that use XML. I know services from Microsoft themselves who use XML. I also know tons of financial systems that still use XML.
Now there might be a time where PHP wants to remove built in functionality (like SimpleXML) but there will always be a way to use PHP with XML and I see XML still being used in some fashion for decades to come.
Is it as prevalent as it use to be? Certainly not. Will all services that support it now still support it 5 years from now? probably no. But as someone who builds integrations and migrations, I see XML being simply offered as an alternative to better mechanisms like JSON because to even support both is not that hard to design.
I wouldn’t worry about XML support in PHP being obsolete or deprecated for a while still.