
{"id":290,"date":"2007-05-21T22:44:47","date_gmt":"2007-05-21T21:44:47","guid":{"rendered":"http:\/\/www.matthijskamstra.nl\/blog\/index.php\/2007\/05\/21\/xml-reader-flash-panel\/"},"modified":"2007-06-11T19:22:54","modified_gmt":"2007-06-11T18:22:54","slug":"xml-reader-flash-panel","status":"publish","type":"post","link":"https:\/\/www.matthijskamstra.nl\/blog\/2007\/05\/21\/xml-reader-flash-panel\/","title":{"rendered":"XML Reader Flash panel"},"content":{"rendered":"<p>When you&#8217;re working with Flash and dynamic content your no stranger to XML.<br \/>\nAnd how to access the data in the XML.<\/p>\n<p>There are a couple of ways you can access and manipulating XML documents in Flash:<\/p>\n<ol>\n<li>the nerdy way (<a href=\"http:\/\/www.w3schools.com\/dom\/default.asp\" title=\"Tutorial XML DOM\">XML DOM<\/a>): <code>my_xml.firstChild.childNodes[2].childNodes[1].attributes.x<\/code><\/li>\n<li>the <a href=\"http:\/\/en.wikipedia.org\/wiki\/XPath\" title=\"Wikipedia knows best\">xPath<\/a> way using <a href=\"http:\/\/www.xfactorstudio.com\/\" title=\"X factor Studio\">xfactorstudio XPath classes<\/a>: <code>xmlDoc.selectNodes(\"\/bookstore\/book[price&gt;35]\/title\")<\/code><\/li>\n<li>the <a href=\"http:\/\/livedocs.adobe.com\/flash\/9.0\/main\/wwhelp\/wwhimpl\/common\/html\/wwhelp.htm?context=LiveDocs_Parts&amp;file=00003785.html\" title=\"Adobe Livedocs\">Flash<\/a> <a href=\"http:\/\/weblogs.macromedia.com\/dehaan\/archives\/2005\/01\/using_xpath_wit.cfm\" title=\"Tutorial from Jen deHaan\">XPathAPI class<\/a>: <code>XPathAPI.selectNodeList(xml.firstChild, \"\/rdf:RDF\/item\/title\")<\/code><\/li>\n<li>the <a href=\"http:\/\/blog.greensock.com\/?cat=3\" title=\"Nice version from Jack Doyle (Greensock)\">XML2Array<\/a> methode: <code>Novel[0].Description[0].value<\/code><\/li>\n<\/ol>\n<p>Before I discovered option 2 \/3 \/4, I had to work with XML DOM. This was also in the periode I was still programming in the Flash <a href=\"http:\/\/en.wikipedia.org\/wiki\/Macromedia_Flash\">IDE<\/a> and the XML DOM methode cost me a lot of time: I couldn&#8217;t find the correct node, or attribute, etc.<\/p>\n<p>Until I started programming in  <a href=\"http:\/\/www.sepy.it\/\">SE|PY<\/a>, because it has a XML Reader. The XML Reader could check if my XML was correctly formatted, and I could just point to the node I wanted to use and it gave me the correct node path.<br \/>\nI don&#8217;t know when it started (probably for a while, because I started to use different methodes to access XML) but sadly this reader has <a href=\"http:\/\/sourceforge.net\/tracker\/index.php?func=detail&amp;aid=1615620&amp;group_id=90749&amp;atid=594689\">some errors<\/a>, which makes it difficult to use.<\/p>\n<p>But why do I care? I needed to use the XML DOM because I didn&#8217;t want to add to the kb of a dynamic banner I was building. It was programmed it in Flash IDE and the SE|PY XML Reader didn&#8217;t work&#8230;.<\/p>\n<h3>Download:<\/h3>\n<p>Without more blabla: here is the first version of XML Reader.<\/p>\n<p class=\"downloadbtn\"><a href=\"#\" onclick=\"location.href='http:\/\/www.matthijskamstra.nl\/blog\/download-manager.php?id=7'\" title=\"XML Reader Flash panel: XML_Reader_v0.1.zip (52kB)\"><strong>XML Reader Flash panel<\/strong> XML_Reader_v0.1.zip (52kB)<\/a><\/p>\n<p>In the zip is also a <a href=\"http:\/\/www.matthijskamstra.nl\/laboratory\/xml_reader\/readme.txt\" title=\"More about XML Reader in a readme.txt\">readme.txt<\/a> with more info about XML Reader.<br \/>\nDoubts? Test drive it <a href=\"#viewxmlreader\">here!<\/a><br \/>\nLet me know what you think of it, what&#8217;s wrong with it, what could improve, bugs, etc<\/p>\n<h3>Description XML Reader<\/h3>\n<p>XML Reader is a Flash window panel where you can load XML files into.<br \/>\nThis is useful in situations when you are writing an XML parser, and need to view the XML your parsing, but don&#8217;t feel like toggling back and forth between Flash and another program.<br \/>\nAs 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.<\/p>\n<p>This XML Reader does more: it has color syntax highlighting, indentation and XML DOM(*) to access and manipulate XML Documents WYSIWYG style.<\/p>\n<p>I hope this will help to increase my productivity, and perhaps yours?<\/p>\n<p>(*) The XML Document Object Model (XML DOM) defines a standard way for accessing and manipulating XML documents.<\/p>\n<h3 id=\"viewxmlreader\">View XML Reader<\/h3>\n<p>So I created <a href=\"http:\/\/www.matthijskamstra.nl\/laboratory\/xml_reader\/\" title=\"View XML Reader with an example\">XML Reader<\/a>, based upon the one in SE|PY<\/p>\n<p>Because the open XML button only works in Flash a <a href=\"http:\/\/www.matthijskamstra.nl\/laboratory\/xml_reader\/xml\/verhaal_jansteen_en.xml\" title=\"XML file example\">example XML<\/a> is loaded.<br \/>\n<iframe loading=\"lazy\" src=\"http:\/\/www.matthijskamstra.nl\/laboratory\/xml_reader\/\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\" height=\"450\" width=\"450\">It seems that you are not able to read the content that suppose to be here: it\u00e2\u20ac\u2122s called iframes. I would suggest to get a browser that does:<a href=\"http:\/\/www.mozilla.com\/en-US\/firefox\/\">Firefox 2.0<\/a><\/iframe><\/p>\n<h3>Thanx to:<\/h3>\n<p>This project is based upon some work of other developers:<\/p>\n<ul>\n<li>The XMLHighlighter class developed by <a href=\"http:\/\/www.shockwave-india.com\/blog\/\">R.Arul Kumaran<\/a> (at the moment of writing this post I couldn&#8217;t visit his site).<br \/>\nThis class is used for highlighting the XML file and my modification makes it possible to &#8216;trace&#8217; the XML-nodes.<\/li>\n<li>The <a href=\"http:\/\/www.jessewarden.com\/archives\/2004\/10\/xml_and_text_vi.html\">XML and Text Viewer Panel<\/a> developed by <a href=\"http:\/\/www.jessewarden.com\/\">Jesse Randall Warden<\/a>. This example showed me how to build a panel.<\/li>\n<li>The <a href=\"http:\/\/www.muzakdeezign.com\/mxi_creator\/\">MXI File Creator<\/a> by <a href=\"http:\/\/www.muzakdeezign.com\/\">Muzakdeezign<\/a>. This free program is used to create and edit the Macromedia Extension (.mxi file).<\/li>\n<li>The <a href=\"http:\/\/www.sephiroth.it\/python\/sepy.php\">XML reader<\/a> from <a href=\"http:\/\/www.sepy.it\/\">SE|PY<\/a> by <a href=\"http:\/\/www.sephiroth.it\/index.php\">Alessandro Crugnola<\/a>.<br \/>\nThis is my free code editor when I&#8217;m not using the Flash IDE editor. And the only (as far as I know) wysiwyg XML Reader. Sadly this reader has <a href=\"http:\/\/sourceforge.net\/tracker\/index.php?func=detail&amp;aid=1615620&amp;group_id=90749&amp;atid=594689\">some errors<\/a>, which makes it difficult to use. So to fix this, I wrote this panel.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>When you&#8217;re working with Flash and dynamic content your no stranger to XML. And how to access the data in the XML. There are a couple of ways you can access and manipulating XML documents in Flash: the nerdy way (XML DOM): my_xml.firstChild.childNodes[2].childNodes[1].attributes.x the xPath way using xfactorstudio XPath classes: xmlDoc.selectNodes(&#8220;\/bookstore\/book[price&gt;35]\/title&#8221;) the Flash XPathAPI class: [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,3],"tags":[39,38,398,37,36],"class_list":["post-290","post","type-post","status-publish","format-standard","hentry","category-extending-flash","category-flash","tag-as2","tag-extending","tag-flash","tag-flash-panel","tag-xml"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/comments?post=290"}],"version-history":[{"count":0,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/posts\/290\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/media?parent=290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/categories?post=290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.matthijskamstra.nl\/blog\/wp-json\/wp\/v2\/tags?post=290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}