Forums

create xml page for flash (2 posts)

  1. michaeldfoley
    Member
    Posted 2 years ago #

    Hi,

    I've been wracking my brain about this and just can't figure it out. I am trying to create a page template that will display the page content as xml to use in a flash file. I created a template that outputs valid xml. For some reason the page works in Safari but not in Firefox. In Firefox it returns an undefined in the flash file. Any ideas on what I can do to solve this issue? Below is the code I am using for the template.

    <?php
    /*
    Template Name: XML
    */
    require('wp-blog-header.php');
    
    header('Content-Type: text/xml');
    
    echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
    
     if(have_posts()) : ?><?php while(have_posts()) : the_post() ?>
    
                            <?php the_content(); ?>
    
                    <?php endwhile; ?>
    
                    <?php endif; ?>

    Thanks for your help

  2. Eric Mann
    Member
    Posted 2 years ago #

    First of all, that won't export a well-formed XML file. You're not creating any valid XML entries ... just a dump of the website with the <?xml ...> tag at the top.

    Second, where are you putting this XML file? Is it just a php file that renders as XML or are you storing an XML file on the server? Either way, I'd also want to see the code you're trying to use to call the file.

    Also, is Firefox giving you a specific error?

Topic Closed

This topic has been closed to new replies.

About this Topic