def _pushWhitespaceBehavior(self, attr):
		"""Push a new string onto the whitespaceBehaviorStack.

		The string's value is taken from the "xml:space" attribute, if it exists
		and has a legal value ("default" or "preserve").  Otherwise, the previous
		stack element is duplicated.

		"""
		assert len(self._whitespaceBehaviorStack) > 0, "Whitespace behavior stack should never be empty!"
		try:
			if attr["xml:space"] == "default" or attr["xml:space"] == "preserve":
				self._whitespaceBehaviorStack.append(attr["xml:space"])
			else:
				raise AimlParserError, "Invalid value for xml:space attribute "+self._location()
		except __HOLE__:
			self._whitespaceBehaviorStack.append(self._whitespaceBehaviorStack[-1])
dataset/ETHPy150Open encorehu/django-buddy/core/aiml/AimlParser.py/AimlHandler._pushWhitespaceBehavior