Creating XML-file with PHP dynamically (general strategy)
NickName:Helen Ask DateTime:2016-11-07T22:21:29

Creating XML-file with PHP dynamically (general strategy)

The core of my website is an XML-file master.xml. I am trying to create feeds out of it, a classic rss-feed and a podcast-feed, which means XML to XML.

The first method I tried was creating a real XML-file with PHP's DomDocument, but I ran into fundamental problems. Even if it works correctly, it still creates a file which is not the file that is being requested.

Now I have changed podcast.xml into podcast.php and echo the XML-declaration and the XML-markup with a loop of the items. Readers like iTunes work perfectly with that. But the browsers can't be fooled for real.

  1. Chrome puts the content into a pseudo-HTML-file and displays plain text, ignoring the xsl-stylesheet. Nonetheless it displays nothing but XML in the codeview.

  2. Firefox displays it like a real XML-file, but in the codeview it shows the closing reddishly as if the was a markup error (which is not the case).

That makes me (as a private person with ambition) wonder how professionals deal with the desire to create feeds dynamically. Surely, I am not the first person who is trying this.

Copyright Notice:Content Author:「Helen」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40467445/creating-xml-file-with-php-dynamically-general-strategy

More about “Creating XML-file with PHP dynamically (general strategy)” related questions

Creating XML-file with PHP dynamically (general strategy)

The core of my website is an XML-file master.xml. I am trying to create feeds out of it, a classic rss-feed and a podcast-feed, which means XML to XML. The first method I tried was creating a real...

Show Detail

Dynamically creating/inserting into an associative array in PHP

I'm trying to build an associative array in PHP dynamically, and not quite getting my strategy right. Basically, I want to insert a value at a certain depth in the array structure, for instance: $...

Show Detail

General strategy for finding the cause of random freezes?

I have a application which randomly freezes, including the IDE and it's driving me mad. That makes me wonder: What's a good general strategy for finding the cause of random freezes?

Show Detail

creating class active dynamically in php

I am creating a menu dynamically based on the categories registered on the dataBase, What I need is: When someone click in the link, this option should have the css class 'active', showing in w...

Show Detail

PHP not return correct number of nodes in XML-file

I'm trying to delete certain nodes from an XML-file using PHP, for some reason it was not working properly and I came to the conclusion that that's probably the case, because PHP is not returning the

Show Detail

Dynamically creating zip with php

What is the easiest way of creating dynamically zip files with php? For example, I have these files on the server, Root -> Folder 1 -> file1.wav Root -> Folder 2 -> file2.jpg I wan...

Show Detail

Passport - override strategy dynamically

I have a node application with passport library. I use passport strategy like this: passport.use(someStrategy) Is it possible to override that strategy later on dynamically? During the applicatio...

Show Detail

Make XML-file inaccessible for user

I am developing a site where students make mathematical exercises. In total there are about 5000 exercises stored in 55 XML-files. The XML-files are stored in a directory in the root of the website...

Show Detail

angular release timing general strategy?

Does Angular have a general strategy for release timing? For example, the following url appears to list a full release history for ng5, from beta.0 to current state: https://jaxenter.com/road-to-a...

Show Detail

how to add fckeditor to a dynamically creating form in php?

I am creating a dynamic form in php. And i want to add fckeditor to this dynamic form. so any idea about to add fckeditor to a dynamically creating form in php??? So how can i post values from the

Show Detail