<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Extending SimpleXML</title>
	<atom:link href="http://blog.extend.ws/2008/02/20/extending-simplexml/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.extend.ws/2008/02/20/extending-simplexml/</link>
	<description>Web:Extend's Development Blog</description>
	<lastBuildDate>Thu, 24 Dec 2009 12:34:47 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: quazardous</title>
		<link>http://blog.extend.ws/2008/02/20/extending-simplexml/comment-page-1/#comment-6298</link>
		<dc:creator>quazardous</dc:creator>
		<pubDate>Thu, 24 Dec 2009 12:34:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extend.ws/2008/02/20/extending-simplexml/#comment-6298</guid>
		<description>have done a little mod to this hack because i wanted that all the xml dom can share the properties

&lt;code&gt;

	static protected $_propertyHackIdAttributeName=&#039;property:id&#039;;
	
	/**
	  * Return the uniqid string for this object.
	  * SimpleXmlElement extend classes cannot have normal properties.
      *
	  *	@return string
	*/
	protected function getPropertyHackId()
	{
		$top=parent::xpath(&#039;/*&#039;);
		$top=$top[0];
		if (empty($top[self::$_propertyHackIdAttributeName]))
		{
			$top[self::$_propertyHackIdAttributeName] = uniqid();
		}
		return (string)$top[self::$_propertyHackIdAttributeName];
	}
	
	static protected $_properties=array();
	
	/**
		Set a property of a SimpleXMLIterator object.

		@param	$name	The name of the property.
		@param	$value The variable to attach to this element. If null it is not attached.
		@return	mixed	The variable attached with the specified name.
	*/
	public function setProperty($name, $value)
	{
		if (!isset(self::$_properties[$this-&gt;getPropertyHackId()]))
		{
			self::$_properties[$this-&gt;getPropertyHackId()] = array();
		}
		self::$_properties[$this-&gt;getPropertyHackId()][$name]=$value;
	}
	
	/**
     * Get a property of a SimpleXMLIterator object.
     *
     * @param	$name	The name of the property.
     * @return	mixed	The variable attached with the specified name.
	*/
	public function getProperty($name)
	{
		if (!isset(self::$_properties[$this-&gt;getPropertyHackId()][$name]))
		{
			throw new Ea_Xml_Element_Exception(&quot;$name : property dos not exist !&quot;);
		}
		return self::$_properties[$this-&gt;getPropertyHackId()][$name];
	}

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>have done a little mod to this hack because i wanted that all the xml dom can share the properties</p>
<p><code></p>
<p>	static protected $_propertyHackIdAttributeName='property:id';</p>
<p>	/**<br />
	  * Return the uniqid string for this object.<br />
	  * SimpleXmlElement extend classes cannot have normal properties.<br />
      *<br />
	  *	@return string<br />
	*/<br />
	protected function getPropertyHackId()<br />
	{<br />
		$top=parent::xpath('/*');<br />
		$top=$top[0];<br />
		if (empty($top[self::$_propertyHackIdAttributeName]))<br />
		{<br />
			$top[self::$_propertyHackIdAttributeName] = uniqid();<br />
		}<br />
		return (string)$top[self::$_propertyHackIdAttributeName];<br />
	}</p>
<p>	static protected $_properties=array();</p>
<p>	/**<br />
		Set a property of a SimpleXMLIterator object.</p>
<p>		@param	$name	The name of the property.<br />
		@param	$value The variable to attach to this element. If null it is not attached.<br />
		@return	mixed	The variable attached with the specified name.<br />
	*/<br />
	public function setProperty($name, $value)<br />
	{<br />
		if (!isset(self::$_properties[$this-&gt;getPropertyHackId()]))<br />
		{<br />
			self::$_properties[$this-&gt;getPropertyHackId()] = array();<br />
		}<br />
		self::$_properties[$this-&gt;getPropertyHackId()][$name]=$value;<br />
	}</p>
<p>	/**<br />
     * Get a property of a SimpleXMLIterator object.<br />
     *<br />
     * @param	$name	The name of the property.<br />
     * @return	mixed	The variable attached with the specified name.<br />
	*/<br />
	public function getProperty($name)<br />
	{<br />
		if (!isset(self::$_properties[$this-&gt;getPropertyHackId()][$name]))<br />
		{<br />
			throw new Ea_Xml_Element_Exception("$name : property dos not exist !");<br />
		}<br />
		return self::$_properties[$this-&gt;getPropertyHackId()][$name];<br />
	}</p>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nika Jones</title>
		<link>http://blog.extend.ws/2008/02/20/extending-simplexml/comment-page-1/#comment-3831</link>
		<dc:creator>Nika Jones</dc:creator>
		<pubDate>Sat, 18 Jul 2009 00:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extend.ws/2008/02/20/extending-simplexml/#comment-3831</guid>
		<description>One additional thing you could do is namespace the unique id attribute so that it will *never* overwrite an attribute with the same name (even though &quot;weeuniqueidhack&quot; is probably not going to be stumbled upon soon.)</description>
		<content:encoded><![CDATA[<p>One additional thing you could do is namespace the unique id attribute so that it will *never* overwrite an attribute with the same name (even though &#8220;weeuniqueidhack&#8221; is probably not going to be stumbled upon soon.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jane Goody</title>
		<link>http://blog.extend.ws/2008/02/20/extending-simplexml/comment-page-1/#comment-1534</link>
		<dc:creator>Jane Goody</dc:creator>
		<pubDate>Fri, 24 Apr 2009 11:03:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extend.ws/2008/02/20/extending-simplexml/#comment-1534</guid>
		<description>Not that I&#039;m impressed a lot, but this is   more than I expected for when I found a link on Digg telling that the info   is awesome. Thanks.</description>
		<content:encoded><![CDATA[<p>Not that I&#8217;m impressed a lot, but this is   more than I expected for when I found a link on Digg telling that the info   is awesome. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to Get Six Pack Fast</title>
		<link>http://blog.extend.ws/2008/02/20/extending-simplexml/comment-page-1/#comment-1286</link>
		<dc:creator>How to Get Six Pack Fast</dc:creator>
		<pubDate>Wed, 15 Apr 2009 16:28:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extend.ws/2008/02/20/extending-simplexml/#comment-1286</guid>
		<description>My friend on Orkut shared this link with me and I&#039;m not dissapointed   that I came here.</description>
		<content:encoded><![CDATA[<p>My friend on Orkut shared this link with me and I&#8217;m not dissapointed   that I came here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: niedziedz</title>
		<link>http://blog.extend.ws/2008/02/20/extending-simplexml/comment-page-1/#comment-318</link>
		<dc:creator>niedziedz</dc:creator>
		<pubDate>Sun, 21 Dec 2008 14:42:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extend.ws/2008/02/20/extending-simplexml/#comment-318</guid>
		<description>In one word: LOL. Very low.</description>
		<content:encoded><![CDATA[<p>In one word: LOL. Very low.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loïc Hoguin</title>
		<link>http://blog.extend.ws/2008/02/20/extending-simplexml/comment-page-1/#comment-222</link>
		<dc:creator>Loïc Hoguin</dc:creator>
		<pubDate>Mon, 06 Oct 2008 22:55:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extend.ws/2008/02/20/extending-simplexml/#comment-222</guid>
		<description>Hello, I&#039;m like 6 months late in replying to comments but I didn&#039;t see them filtered. There&#039;s probably a problem with the mails that I&#039;ll have to fix or something...

I&#039;ll just point out that the class name is a convention we decided and leave it at that. We prefix the classes with &quot;wee&quot; to protect from conflicts with other libraries.

We did not use the PHPUnit framework for various reasons, some of which I&#039;ll explain in a post soon. This is both a good thing and a bad thing. The good thing is to not have to write a lot of code that isn&#039;t related to the tests themselves. We (and probably a lot of people) are pretty lazy so writing tests should be as simple as possible, eliminating all the annoying syntax. We intend to put a lot of tests, we already have hundreds, we need thousands to make sure the framework works as intended. It&#039;s a lot of work, and we reduced the amount of work by a good chunk by writing this module. Note that it is designed specifically for our framework&#039;s needs and is light enough to be redistributed with it, allowing anyone to just &quot;make test&quot; to check if it&#039;ll work correctly without having to install PHPUnit or to redistribute it (it&#039;s quite big). However, if you need to test your applications, then please use PHPUnit, as you probably already know it&#039;s a great unit testing framework.</description>
		<content:encoded><![CDATA[<p>Hello, I&#8217;m like 6 months late in replying to comments but I didn&#8217;t see them filtered. There&#8217;s probably a problem with the mails that I&#8217;ll have to fix or something&#8230;</p>
<p>I&#8217;ll just point out that the class name is a convention we decided and leave it at that. We prefix the classes with &#8220;wee&#8221; to protect from conflicts with other libraries.</p>
<p>We did not use the PHPUnit framework for various reasons, some of which I&#8217;ll explain in a post soon. This is both a good thing and a bad thing. The good thing is to not have to write a lot of code that isn&#8217;t related to the tests themselves. We (and probably a lot of people) are pretty lazy so writing tests should be as simple as possible, eliminating all the annoying syntax. We intend to put a lot of tests, we already have hundreds, we need thousands to make sure the framework works as intended. It&#8217;s a lot of work, and we reduced the amount of work by a good chunk by writing this module. Note that it is designed specifically for our framework&#8217;s needs and is light enough to be redistributed with it, allowing anyone to just &#8220;make test&#8221; to check if it&#8217;ll work correctly without having to install PHPUnit or to redistribute it (it&#8217;s quite big). However, if you need to test your applications, then please use PHPUnit, as you probably already know it&#8217;s a great unit testing framework.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: information</title>
		<link>http://blog.extend.ws/2008/02/20/extending-simplexml/comment-page-1/#comment-182</link>
		<dc:creator>information</dc:creator>
		<pubDate>Wed, 28 May 2008 07:19:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extend.ws/2008/02/20/extending-simplexml/#comment-182</guid>
		<description>Excellent function. It saved my day. Thanks!</description>
		<content:encoded><![CDATA[<p>Excellent function. It saved my day. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nhm tanveer hossain khan(hasan)</title>
		<link>http://blog.extend.ws/2008/02/20/extending-simplexml/comment-page-1/#comment-128</link>
		<dc:creator>nhm tanveer hossain khan(hasan)</dc:creator>
		<pubDate>Fri, 28 Mar 2008 16:36:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extend.ws/2008/02/20/extending-simplexml/#comment-128</guid>
		<description>bit curious, what is the advantage of having class name in lower case ?
and why didn&#039;t you use php unit or other popular php unit testing framework ?</description>
		<content:encoded><![CDATA[<p>bit curious, what is the advantage of having class name in lower case ?<br />
and why didn&#8217;t you use php unit or other popular php unit testing framework ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Very SimpleXML - PHPUGFFM - PHP User Group Frankfurt am Main</title>
		<link>http://blog.extend.ws/2008/02/20/extending-simplexml/comment-page-1/#comment-60</link>
		<dc:creator>Very SimpleXML - PHPUGFFM - PHP User Group Frankfurt am Main</dc:creator>
		<pubDate>Tue, 18 Mar 2008 12:41:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.extend.ws/2008/02/20/extending-simplexml/#comment-60</guid>
		<description>[...] 2: Extending SimpleXML (LoÃ¯c Hoguin, [...]</description>
		<content:encoded><![CDATA[<p>[...] 2: Extending SimpleXML (LoÃ¯c Hoguin, [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

