PHP Classes

Thnks for XML

Recommend this page to a friend!

      Diagram 2  >  All threads  >  Thnks for XML  >  (Un) Subscribe thread alerts  
Subject:Thnks for XML
Summary:Will there be a array version ?
Messages:9
Author:marco v
Date:2005-03-09 22:56:54
Update:2005-03-22 12:21:11
 

  1. Thnks for XML   Reply   Report abuse  
Picture of marco v marco v - 2005-03-09 22:56:54
Thanks for this great class. It looks beautifull. This is just like we need. A nice clean diagram that also looks unbelivable.

I have some questions though.

Most of us use this to display some data from a mysql database. I also think that not a whole lot use xml with this data. In my case, i have to write a functions that creates the xml nodes when i got all the data from my database. The question is, can you assist with this ? maybe give an example how to do this.

ANd: will there me a version sothat we can use arrays iso xml ?. My knowelage of php isn't that much sothat i and maybe others can use some example in how to use this in a real application.

I want to use it to display this diagram when records in a database contains the same data. Ex: Find all books with the same writer and display this with their titles, publisher and years. This data is coming from a database so:

Writer Name
Bookname Bookname Bookname Bookname
Year publisher Year publisher Year publisher Year publisher

SO an example how to create the xml / array that can be passed to the class would be very meaningfull.

Thanks for your contribution !

Marco

  2. Re: Thnks for XML   Reply   Report abuse  
Picture of Diogo Resende Diogo Resende - 2005-03-10 14:23:48 - In reply to message 1 from marco v
Thank you for your reply. I updated the class to have the possibility to load arrays. The array structure is the same. Hope you like it.

Diogo

  3. Re: Thnks for XML   Reply   Report abuse  
Picture of marco v marco v - 2005-03-10 16:38:37 - In reply to message 1 from marco v
Thank you for the reply. But now none of your examples work. Also test2.html loads test.php i.s.o. test2.php. When i change this in the html, it still does not work.

Please check your archive maybe you send the wrong one.

While your at it, is it too much to ask (yes... i ask nicely) to make this example a snippet for a mysql retrievel just like i suggested in my original message ?

  4. Re: Thnks for XML   Reply   Report abuse  
Picture of Diogo Resende Diogo Resende - 2005-03-10 17:03:31 - In reply to message 3 from marco v
The test1.html and test2.html use test.php
test2.php shouldn't use any of the html nor xml. It loads the class, creates an example array and loads it into diagram.
If any error output occurs, please send it.

  5. Re: Thnks for XML   Reply   Report abuse  
Picture of Jens Kjelsbak Jens Kjelsbak - 2005-03-21 12:57:08 - In reply to message 4 from Diogo Resende
Hi Diogo,

Great work - very useful to a number of applications.
Your examples (test1.html and test2.html) are very good and makes the prototype building easy. Is it possible for you to make a small array example that will generate the same as test2.html?

I'll forward to your work around linking URL's, MySQL and Diagram 2 :-)

Keep up the good work....

Very best regards,

/jens

  6. Re: Thnks for XML   Reply   Report abuse  
Picture of Diogo Resende Diogo Resende - 2005-03-21 14:31:12 - In reply to message 5 from Jens Kjelsbak
Hi,

I'm uploading some extra files for you to test ;)
Download all and check test4.php. It should now work. I've done with DIV tags but you can make them with MAP tags.

  7. Re: Thnks for XML   Reply   Report abuse  
Picture of Diogo Resende Diogo Resende - 2005-03-21 14:37:09 - In reply to message 5 from Jens Kjelsbak
Jens,

About the array structure to achieve the test2 it's impossible at the moment because the array only supports name attribute. You can only use some functions to change global attributes and set the array and it will be equal to all nodes.
To achieve the customization you should use xml. It's not hard and you can send xml to the class without pointing a file, using loadXmlData() ;)

Regards,
Diogo

  8. Re: Thnks for XML   Reply   Report abuse  
Picture of marco v marco v - 2005-03-21 20:53:19 - In reply to message 7 from Diogo Resende
Thanks for the mapping !! it works as expected. Now if you find the time for building a diagram from arrays retrieved from a mysql database, it is a complete package for even novice programmers !

This is a unique package i believe that nobody wrote before.

Marco

  9. Re: Thnks for XML   Reply   Report abuse  
Picture of Jens Kjelsbak Jens Kjelsbak - 2005-03-22 12:21:11 - In reply to message 7 from Diogo Resende
Hi Diogo,

I came to the same conclusion about the limited use of array's, but I was unsure if I got it right. I'll look into the loadXmlData() function. Thanks!

Very best regards,

/jens