anakcerdas wrote:
1. Please correct me if I'm mistaken, your Array to XML class should work to other kind of PHP database query, right? If it's so, then what is the item name of the rendered XML node?
Yes. you can convert any array to XML. The class doesn't work directly with the database, so I really doesn't matter. You'll may choose de item's name when initializing the object:
Code:
<? /* XmlGenerator params: channel, array with structure, start level, first node's name */
$xml = new XmlGenerator("mainmenu", $familyTree, 0, null,'menuItems' ); ?>
Quote:
How do I get a rendered XML test file from the query, so I can get good understanding how the XML is rendered by using this class?
you can use any array to test it... for example:
Code:
<?php $array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
$xml = new XmlGenerator("myTest", $array );
echo $xml->createXml(); ?>
Quote:
2. in your flash mainmenu PHP file, there's a line:
$xml = new XmlGenerator("mainmenu", $familyTree, 0, null,'menuItems' ); --> where this 'menuItems' come from?
And it seems that this PHP file only get XML data with 'menuItems' node name in it, isnt't it?
menuitems didn't "came" from anywhere. It is passed to the script to create the xml. "mainmenu" is the channel. "menuitems" will be the tag used for each item inside that channel.
I recommend you to access your x-gen-mainmenu.php with your browser and then see the generated source. I guess you'll understand right away how does it works.
Quote:
3. How deep can this class go in rendering to XML data?
To be honest, I don't know

my class is a simple&dirty array2xml conversor... It *should* work OK exporting data from joomla (or any other cms) although there are a few known issues (or half-implemented features):
- my class [still] doesn't support attributes (it means that you can generate tags like this:
but you can create something like:
Code:
<menu>
<type>content</type>
<itemid>35<itemid>
<name>Hello World</name>
</menu>
there is also a faster way to import data into flash (someone mailed me about I didn't find his e-mail when I had time enough to implement o_O).
Anyway, I've blogged about this flash and Joomla! integration, maybe you find something interesting here:
http://www.joomla.com.br/blog/category/code/php/joomla/ (I was supposed to be working in a 100% flash/joomla site right now but the project is delayed... something wrong with the design I guess)
I'm glad someone is using my stuff

cheers,
bigo