Skip to content
Advertisement

Tag: xml

How to retrieve an attribute from a namespaced element

I am trying to get the url attributes from the <media:content> elements in this RSS feed: Here’s what I have so far: This code works for all elements except the ones with a semicolon in the name, like <media:content> or <dc:contributor>. If I open the XML feed in my browser I can see the tag I am looking for: I

Alphabetize Petfinder API List

I’m using the Petfinder API for Wordpress plugin. The plugin defaults to listing animals based on how old the Petfinder entries are, from oldest to newest. I’m trying to figure out a way to either do newest to oldest, or alphabetize based on animal names. The data is loaded via the following code: And the code that creates the list

PHP Iterate Multiple Children from XML

I’m trying to read an XML file in PHP which has multiple same-named nodes inside a parent. So far, I can read the first iteration of the XML node but then PHP moves to the next parent even though …

Proper way to send (POST) xml with guzzle 6

I want to perform a post with guzzle sending an xml file. I did not find an example. What I ‘ve done so far is : No matter what I try I get back error -1 which means that xml is not valid. XML that I send passes online validation though and is valid %100 Please help. Answer After some

SimpleXmlElement Parsing Errors

Just had a WordPress site updated with the latest Custom Contact Forms. After the update the site is no longer loading and I see these errors: The first error refers to this function: But these errors are only PHP warnings, not fatal errors. But I get the white screen of death anyways. I am not familiar with XML and XML

simplexml_load_file does not recognize tags

I am trying to use simplexml_load_file() to load an XML file and reach <dc:title> tags, but when I dump the $xml variable that loaded my xml file all the tags that starts with <dc: doesn’t show. Is there a way of telling the parser to include them? should I use a different parser? Here’s my example file’s code: Code I

Advertisement