How to dynamically generate XML file that uses variables from the Posts loop
-
I am trying to use some PHP/SWF Chart generation software. This software reads in an xml file (or a .php file that generate valid XML) to obtain the data is needs to plot in the chart it will generate. So my requirements for this technology is a path to a file that contains valid XML.
I want to dynamically create a chart for every post on my site. In my functions.php i have a function augment_post() which is called once for every post. In the “augment_post()” function, I want to print the code for the Chart SWF file which in turn contains the path to the data XML file. In order to create the XML file, I need to pass 2 arrays that exist in augment_post() to whatever function/php script will be generating the XML.
So essentially the sequence is this:
1) Process each $post in the hasPost loop
2) for each $post, process $augment_post()
3) augment_post() sets values for $parameter1 and $parameter2
4) augment_post() echo’s the OBJECT declaration use to embed the chart
5) in this OBJECT declaration is a path to a generate_xml.PHP file that generates the data XML for the chart
6) generate_xml.php contains php code that generates the data XML based on $parameter1 and $parameter2 as set in augment_post()How can I pass $parameter1 and $parameter2 (which happen to both be rather large arrays) to generate_xml.php ? SHould generate_xml.php be a plugin? I dont understand how I can get generate_xml.php these array parameters, when generate_xml.php is actually run on a seperate HTTPRequest .. (the Chart SWF file makes the actual HTTP request to generate_xml.php)
Hope my explanation isnt too confusing — Im stumped on this one.
- The topic ‘How to dynamically generate XML file that uses variables from the Posts loop’ is closed to new replies.