/* Plugin Name: XML Reader Plugin URI: http://www.matthijskamstra.nl/blog/ Description: XML Reader is a Flash window panel where you can load XML files into, with color syntax highlighting, indentation and XML DOM to access and manipulate XML Documents. Version: 0.1 Author: Matthijs C. Kamstra aka [mck] Author URI: http://www.matthijskamstra.nl/blog/ License: Creative Commons Attribution-ShareAlike */ _________________ ++ Description ++ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ XML Reader is a Flash window panel where you can load XML files into. This is useful in situations when you are writing an XML parser, and need to view the XML your parsing, but don't feel like toggling back and forth between Flash and another program. As a Flash panel, you can simply dock it inside of Flash with your other panels, and have it always available while you code in the Flash IDE. This XML Reader does more: it has color syntax highlighting, indentation and XML DOM(*) to access and manipulate XML Documents WYSIWYG style. I hope this will help to increase my productivity, and perhaps yours? (*) The XML Document Object Model (XML DOM) defines a standard way for accessing and manipulating XML documents. ______________ ++ Features ++ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻ * Indentation; to make your XML code appear better and more readable. * Color syntax highlighting * XML Document Object Model (XML DOM) * Load local XML documents * Refresh button * Word wrap * enable CDATA * WYSIWYG ________________________ ++ Usage instructions ++ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ * Download Adobe Extension Manager [http://www.adobe.com/exchange/em_download/], if you don't already have it installed (it for free). * Download the zip [http://www.matthijskamstra.nl/blog/download-manager.php?id=xxx] file and decompress on your computer. * Install XML Reader.mxp * double click 'XML Reader.mxp' * Open Adobe Extension Manager and instal 'XML Reader.mxp' * Restart Flash * Access XML Reader: Windows > Other Panels > at the bottom of the list you will find XML Reader __________________ ++ Code example ++ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ Place this code in Flash: ///////////////////////////////////////// // Load a XML file var thisObj = this; var my_xml:XML = new XML (); my_xml.ignoreWhite = true; my_xml.onLoad = function (success:Boolean) { thisObj.traceFunction (); }; my_xml.load ("http://www.flash-mx.com/mm/problems/products.xml"); // // Use this function to trace the result function traceFunction () { // use the XML you just loaded; in this case 'my_xml' // copy and paste the results from XML Reader after 'my_xml.' // trace (my_xml.); // Example: trace (my_xml.firstChild.childNodes[4].childNodes[1].childNodes[0]); // Output: Cash (cold-hard) } ///////////////////////////////////////// Load the XML into XML Reader panel and just point to the node you want to access. ____________________________ ++ Changelog ++ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ * XML Reader v 0.1 [2007-05-xx] - Initial release _____ Todo: ŻŻŻŻŻ * Loading XML from URL * Code folding * XML Parsing Errors * XML loading feedback * XPath * .... * Do you have a feature/bug/comment, let me know at [http://www.matthijskamstra.nl/blog] ________ Thanx to: ŻŻŻŻŻŻŻŻ This project is based upon some work of other developers: * The XMLHighlighter class developed by R.Arul Kumaran [www.shockwave-india.com/blog] This class is used for highlighting the XML file and my modification makes it possible to 'trace' the XML-nodes. * The XML and Text Viewer Panel [http://www.jessewarden.com/archives/2004/10/xml_and_text_vi.html] developed by Jesse Randall Warden. This example showed me how to build a Flash panel. * The MXI File Creator [http://www.muzakdeezign.com/mxi_creator]. This free program is used to create and edit the Macromedia Extension (.mxi file). * The XML reader [http://www.sephiroth.it/python/sepy.php] from SE|PY [http://www.sepy.it/] by Alessandro Crugnola. This is my free code editor when I'm not using the Flash IDE editor. And the only (as far as I know) WYSIWYG XML Reader. Sadly this reader has some errors, which makes it difficult to use. So to fix this, I wrote this panel.