<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>xml &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<atom:link href="https://blog.sephiroth.it/tag/xml/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sephiroth.it</link>
	<description>programmer by pure chance</description>
	<lastBuildDate>Thu, 17 Jun 2010 21:33:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.sephiroth.it/wp-content/uploads/2019/03/cropped-sepy-big-32x32.png</url>
	<title>xml &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<link>https://blog.sephiroth.it</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>E4X, ActionScript 3 new &#8220;sublanguage&#8221;</title>
		<link>https://blog.sephiroth.it/2006/07/12/e4x-actionscript-3-new-sublanguage/</link>
					<comments>https://blog.sephiroth.it/2006/07/12/e4x-actionscript-3-new-sublanguage/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Wed, 12 Jul 2006 23:56:34 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[e4x]]></category>
		<category><![CDATA[ecma]]></category>
		<category><![CDATA[geko]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=159</guid>

					<description><![CDATA[actionscript3 e4x<br />
]]></description>
										<content:encoded><![CDATA[<p>Since I&#8217;ve heard the voices about the upcoming <a href="http://www.ecma-international.org/publications/standards/Ecma-357.htm" target="_blank">E4x</a> in actionscript 3 I awaited this moment&#8230;<br />
Finally <a href="http://livedocs.macromedia.com/flex/2/langref/XML.html" target="_blank">ActionScript supports E4X</a> and we can kick away the old XML object (always supported for backward compatibility)! we can stop using all the various xml2object classes created in these years, we finally have a <strong>validating parser</strong>, so we will see finally well formatted XML files from flash users 🙂<br />
But finally we have a powerful &#8220;language&#8221; with a very strong syntax.</p>
<p>I&#8217;ve written a small tutorial with a quick guide  about actionscript3 and e4x basic syntax (without including Namespaces and QNames for the moment)</p>
<p><a href="http://www.sephiroth.it/tutorials/flashPHP/E4X/index.php">http://www.sephiroth.it/tutorials/flashPHP/E4X/index.php </a></p>
<p>P.s. I forgot to say that E4X is also available in the Geko1.8 browser (such as Firefox 1.5). For more info see this article: <a href="http://developer.mozilla.org/en/docs/E4X" target="_blank">http://developer.mozilla.org/en/docs/E4X</a>. Unfortunately E4X ins&#8217;t supported by python, neither there&#8217;s a module for it 🙁</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/07/12/e4x-actionscript-3-new-sublanguage/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Actionscript 3 ?</title>
		<link>https://blog.sephiroth.it/2005/10/08/actionscript-3/</link>
					<comments>https://blog.sephiroth.it/2005/10/08/actionscript-3/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Sat, 08 Oct 2005 22:27:54 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[ecma]]></category>
		<category><![CDATA[jit]]></category>
		<category><![CDATA[w3c]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=108</guid>

					<description><![CDATA[actionscript 3
]]></description>
										<content:encoded><![CDATA[<p>Recently Macromedia release some news about Flex 2&#8230;and what we can find in one page (<a href="http://www.macromedia.com/devnet/flex/articles/flex2_intro.html" target="_blank">you can see it here</a>) ?<br />
<span style="font-style: italic;">&#8220;With ActionScript 3.0, we have achieved more than simple compliance with the ECMAScript standard; Macromedia now chairs the ECMAScript committee and helps drive its evolution. ActionScript 3.0 features a compilation mode for stronger compile-time type checking that provides the benefits of languages such as Java or C#. It supports new features to streamline data manipulation, including the E4X (ECMAScript for XML) standard, which extends the language and adds XML as a native data type allowing developers to more naturally interact with and manipulate XML. It adds regular expressions support for better text parsing and processing. It sheds some of the ad hoc event handling schemes in the old virtual machine in favor of a unified model based on the W3C DOM Events standard. And it has significantly updated APIs aimed at the application developer audience.<br />
For a complete overview of the new capabilities, stay tuned as we release an overview of ActionScript 3.0 and the Flash Player 8.5 alpha.&#8221;</span></p>
<p>It seems that on 17th October we&#8217;ll have a public preview of Flash Player 8.5&#8230;I&#8217;m  curious a lot!<br />
<a href="http://www.macromedia.com/devnet/flex/articles/flex2_intro.html">http://www.macromedia.com/devnet/&#8230;/flex2_intro.html</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2005/10/08/actionscript-3/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Will Flash 8 support E4X?</title>
		<link>https://blog.sephiroth.it/2005/05/23/will-flash-8-support-e4x/</link>
					<comments>https://blog.sephiroth.it/2005/05/23/will-flash-8-support-e4x/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Mon, 23 May 2005 19:55:58 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[e4x]]></category>
		<category><![CDATA[ecma]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=82</guid>

					<description><![CDATA[flash e4x<br />
]]></description>
										<content:encoded><![CDATA[<p>An <a href="http://groups.yahoo.com/group/flexcoders/message/15305" target="_blank">unintentionally</a> mail posted in the Flex mailing list talks about one of the new Flex 2.0 features, the support of E4X.<br />
This means that probably the new flash player will support it also&#8230; This should be a great step over the old &#8220;DOM&#8221; flash support.. in this case XML entities will be threated as builtins objects   Read more about ECMAScript for XML (E4X) Specification: <a href="http://www.ecma-international.org/publications/standards/Ecma-357.htm" target="_blank">http://www.ecma-international.org/publications/standards/Ecma-357.htm</a></p>
<p><a href="http://groups.yahoo.com/group/flexcoders/message/15305">see the original post</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2005/05/23/will-flash-8-support-e4x/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>XML2Object revisited</title>
		<link>https://blog.sephiroth.it/2005/03/06/xml2object-revisited/</link>
					<comments>https://blog.sephiroth.it/2005/03/06/xml2object-revisited/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Mon, 07 Mar 2005 05:10:14 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xml2object]]></category>
		<category><![CDATA[xmlobject]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=66</guid>

					<description><![CDATA[xml2object revised<br />
]]></description>
										<content:encoded><![CDATA[<p>An <strong>XML2Object</strong> revisited class.<br />
Basically it works in the same ways as the previius one,  but now in the parseXML method it can be defined a 2nd parameter which will tell to the parser to put all xml nodes into arrays. In this way all variables created into the returned object will be stored into array. for example:</p>
<pre class="tutorialCode">import it.sephiroth.XMLObject;
myxml.onLoad = function(){
     	var data = new XMLObject().parseXML( this, true );
}</pre>
<p>The second addition to this class is the parseObject method, which will convert any object into an xml. for example, this code:</p>
<pre class="tutorialCode">import it.sephiroth.XMLObject;
myobject = {
   	attributes : {
    		name : "custom object",
    		type : 1   	},
   	item : [   { name : "Varese", code : "VA" },   { name : "Milano", code : "MI" }  ],
   	channel : {   name : "City",   country : "Italy"  } }
data = new XMLObject().parseObject(myobject,"TEST");</pre>
<p>will produce this xml string:</p>
<pre class="tutorialCode">&lt;?xml version="1.0"?&gt; 	&lt;TEST type="1" name="custom object"&gt; 		&lt;item&gt; 			&lt;name&gt;Varese&lt;/name&gt; 			&lt;code&gt;VA&lt;/code&gt; 		&lt;/item&gt;   		&lt;item&gt;    			&lt;name&gt;Milano&lt;/name&gt;    			&lt;code&gt;MI&lt;/code&gt;   		&lt;/item&gt;   		&lt;channel&gt;    			&lt;name&gt;City&lt;/name&gt;    			&lt;country&gt;Italy&lt;/country&gt;   		&lt;/channel&gt;  	&lt;/TEST&gt;</pre>
<p>And here&#8217;s the class code: <strong><a href="/wp-content/uploads/2005/03/XMLObject.as">XMLObject.as</a></strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2005/03/06/xml2object-revisited/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>XML2Object</title>
		<link>https://blog.sephiroth.it/2004/01/13/xml2object/</link>
					<comments>https://blog.sephiroth.it/2004/01/13/xml2object/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Tue, 13 Jan 2004 19:25:59 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xmlobject]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=9</guid>

					<description><![CDATA[This class, that is just a translation of a simple set of function written for Flash MX, translates any kind of XML document into a readable Flash Object. This could be the core for projects XML oriented.. in fact i work often on xml based projects&#8230; /** * @class it.sephiroth.XML2Object * @author Alessandro Crugnola * &#8230; <a href="https://blog.sephiroth.it/2004/01/13/xml2object/" class="more-link">Continue reading <span class="screen-reader-text">XML2Object</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">This class, that is just a translation of a simple set of function written for Flash MX, translates any kind of XML document into a readable Flash Object. This could be the core for projects XML oriented..<br />
in fact i work often on xml based projects&#8230; </span></p>
<pre>/**
* @class it.sephiroth.XML2Object
* @author Alessandro Crugnola
* @version 1.0
* @description return an object with the content of the XML translated
* NOTE: a node name with "-" will be replaced with "_" for flash compatibility.
* for example  will become FIRST_NAME
* If a node has more than 1 child with the same name, an array is created with the children contents
* The object created will have this structure:

* 	- obj {

*		nodeName : {

*			attributes : an object containing the node attributes

*			data : an object containing the node contents

*	}

* @usage data = new XML2Object().parseXML( anXML);
*/
//import utils.string

class it.sephiroth.XML2Object extends XML {
	private var oResult:Object = new Object ();
	private var oXML:XML;
	/**
	* @method get xml
	* @description return the xml passed in the parseXML method
	* @usage theXML = XML2Object.xml
	*/
	public function get xml():XML{
		return oXML
	}
	/**
	* @method public parseXML
	* @description return the parsed Object
	* @usage XML2Object.parseXML( theXMLtoParse );
	* @param sFile XML
	* @returns an Object with the contents of the passed XML
	*/
	public function parseXML (sFile:XML):Object {
		this.oResult = new Object ();
		this.oXML = sFile;
		this.oResult = this.translateXML();
		return this.oResult;
	}
	/**
	* @method private translateXML
	* @description core of the XML2Object class
	*/
	private function translateXML (from, path, name, position) {
		var xmlName:String;
		var nodes, node, old_path;
		if (path == undefined) {
			path = this;
			name = "oResult";
		}
		path = path[name];
		if (from == undefined) {
			from = new XML (this.xml);
			from.ignoreWhite = true;
		}
		if (from.hasChildNodes ()) {
			nodes = from.childNodes;
			if (position != undefined) {
				var old_path = path;
				path = path[position];
			}
			while (nodes.length &gt; 0) {
				node = nodes.shift ();
				xmlName = node.nodeName.split("-").join("_");
				if (xmlName != undefined) {
					var __obj__ = new Object ();
					__obj__.attributes = node.attributes;
					__obj__.data = node.firstChild.nodeValue;
					if (position != undefined) {
						var old_path = path;
					}
					if (path[xmlName] != undefined) {
						if (path[xmlName].__proto__ == Array.prototype) {
							path[xmlName].push (__obj__);
							name = node.nodeName;
							position = path[xmlName].length - 1;
						} else {
							var copyObj = path[xmlName];
							path[xmlName] = new Array ();
							path[xmlName].push (copyObj);
							path[xmlName].push (__obj__);
							name = xmlName;
							position = path[xmlName].length - 1;
						}
					} else {
						path[xmlName] = __obj__;
						name = xmlName;
						position = undefined;
					}
				}
				if (node.hasChildNodes ()) {
					this.translateXML (node, path, name, position);
				}
			}
		}
		return this.oResult;
	}
}</pre>
<p><strong>An Example usage with this file:</strong><br />
<a href="http://www.sephiroth.it/tutorials/flashPHP/indice.xml" target="_blank">http://www.sephiroth.it/tutorials/flashPHP/indice.xml</a></p>
<pre>import it.sephiroth.XML2Object;
var oXML:XML = new XML ();
var sXML:String = "indice.xml";
oXML.ignoreWhite = true;
function xmlLoaded (success:Boolean) {
        if (success) {
                trace (success);
                _root.ObjFromXML = new XML2Object ().parseXML (this);
                delete this
        }
}
oXML.onLoad = xmlLoaded;
oXML.load (sXML);</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/01/13/xml2object/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>A PHP domxml class in flash style!</title>
		<link>https://blog.sephiroth.it/2003/12/02/a-php-domxml-class-in-flash-style/</link>
					<comments>https://blog.sephiroth.it/2003/12/02/a-php-domxml-class-in-flash-style/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Tue, 02 Dec 2003 19:30:41 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=6</guid>

					<description><![CDATA[Some days ago Daniele, a friend of mine, point my attention to an opensource project hosted on sourceforge that is very interesting for PHP/Flash guys &#240;&#159;&#153;&#130; This module permit to do an xml parsing, in PHP, using a dom xml in the same way we already do in flash. Here a little example i made &#8230; <a href="https://blog.sephiroth.it/2003/12/02/a-php-domxml-class-in-flash-style/" class="more-link">Continue reading <span class="screen-reader-text">A PHP domxml class in flash style!</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">Some days ago Daniele, a friend of mine, point my attention to an opensource project hosted on sourceforge that is very interesting for PHP/Flash guys 🙂<br />
This module permit to do an xml parsing, in PHP, using a dom xml in the same way we already do in flash.</span></p>
<p>Here a little example i made using this class:</p>
<pre>&lt;?
// include the php module
include('lib.xml.inc.php');
// load an external xml source
$test = new XML('test.xml');

// make a simple parsing, in AS style ;)
$childs = $test-&gt;firstChild-&gt;childNodes;
for($a = 0; $a &lt; count($childs); $a++){	
echo "nodeName " . $childs[$a]-&gt;nodeName . "&lt;br /&gt;";	
echo "nodeValue " . $childs[$a]-&gt;firstChild-&gt;nodeValue . "&lt;br /&gt;";
}
?&gt;</pre>
<p>as you can see, we&#8217;re already familiar with firstChild, nodeName, nodeValue&#8230; etc..<br />
I always hate the PHP SAX parser, and always always prefer a dom xml parser, much more simple to create and to read.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2003/12/02/a-php-domxml-class-in-flash-style/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
