From johnsonm@rpath.com Mon Dec 15 20:02:14 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK2Ecb022625
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:02:14 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK2EUJ019451
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:14 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK2Eg7012270
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:14 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK2DIJ026809
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:13 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK2DOe026807
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:02:13 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152002.mBFK2DOe026807@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:02:13 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: initial parsing code
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:02:14 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/__init__.py xobj/xobj.py

initial parsing code

diff -r 000000000000 -r 6f6ac7d2d649 xobj/xobj.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xobj/xobj.py	Fri Dec 05 09:54:13 2008 -0500
@@ -0,0 +1,104 @@
+from lxml import etree
+
+class XObject(object):
+
+    pass
+
+class XObjParseException(Exception):
+
+    pass
+
+def smiter(item):
+    if hasattr(item, '__iter__'):
+        return item
+    else:
+        return [ item ]
+
+def parse(xml, schemaXml = None):
+
+    def nsmap(s):
+        map = { '{http://www.w3.org/2001/XMLSchema}' : 'xsd_' }
+        for key, val in map.iteritems():
+            if s.startswith(key):
+                s = s.replace(key, val)
+
+        return s
+
+    def flatten(el):
+        if hasattr(el, 'xsd_sequence'):
+            el = el.xsd_sequence
+
+        return el
+
+    def parseElement(element, schemaXObj = None):
+        xsdElement = None
+        if schemaXObj:
+            for e in smiter(schemaXObj.xsd_element):
+                if e.name == element.tag:
+                    xsdElement = e
+                    break
+
+            if not xsdElement:
+                raise XObjParseException('element %s not found' %
+                                            element.tag)
+
+            if hasattr(xsdElement, 'xsd_complexType'):
+                xsdElement = xsdElement.xsd_complexType
+
+        if not element.items() and not element.getchildren():
+            return element.text
+
+        xobj = XObject()
+        for (key, val) in element.items():
+            if xsdElement:
+                xsdAttribute = None
+                for attr in smiter(xsdElement.xsd_attribute):
+                    if attr.name == key:
+                        xsdAttribute = attr
+                        break
+
+                if not xsdAttribute:
+                    raise XObjParseException('attribute %s for element %s not '
+                                             'found' % (key, element.tag))
+
+                if hasattr(xsdAttribute, 'type'):
+                    if xsdAttribute.type == 'xs:integer':
+                        val = int(val)
+
+            key = nsmap(key)
+            xobj.__setattr__(key, val)
+
+        for childElement in element.getchildren():
+            tag = nsmap(childElement.tag)
+            child = parseElement(childElement, flatten(xsdElement))
+
+            if hasattr(xobj, tag):
+                cur = xobj.__getattribute__(tag)
+                if type(cur) == list:
+                    cur.append(child)
+                else:
+                    xobj.__setattr__(tag, [ cur, child ])
+            else:
+                xobj.__setattr__(tag, child)
+
+        return xobj
+
+    if schemaXml:
+        schemaXObj = parse(schemaXml)
+    else:
+        schemaXObj = None
+
+    return parseElement(xml.getroot(), schemaXObj)
+
+def parsef(f, schemaf = None):
+    if schemaf:
+        schemaXml = etree.parse(schemaf)
+        schemaXObj = parse(schemaXml)
+        schemaObj = etree.XMLSchema(schemaXml)
+    else:
+        schemaXml = schemaXObj = schemaObj = None
+
+    parser = etree.XMLParser(schema = schemaObj)
+    xml = etree.parse(f, parser)
+
+    return parse(xml, schemaXml = schemaXml)

From johnsonm@rpath.com Mon Dec 15 20:02:28 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK2Sv6022631
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:02:28 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK2RoU019463
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:27 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK2RPS012277
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:27 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK2RN3026920
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:27 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK2RdQ026912
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:02:27 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152002.mBFK2RdQ026912@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:02:26 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: use dynamic classes for each element
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:02:28 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

use dynamic classes for each element

diff -r 6f6ac7d2d649 -r ebc17a0c41f0 xobj/xobj.py
--- a/xobj/xobj.py	Fri Dec 05 09:54:13 2008 -0500
+++ b/xobj/xobj.py	Fri Dec 05 21:55:14 2008 -0500
@@ -48,7 +48,10 @@
         if not element.items() and not element.getchildren():
             return element.text
 
-        xobj = XObject()
+        # create a subclass for this type
+        NewClass = type(element.tag + '_XObj_Type', (XObject,), {})
+        xobj = NewClass()
+
         for (key, val) in element.items():
             if xsdElement:
                 xsdAttribute = None

From johnsonm@rpath.com Mon Dec 15 20:02:39 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK2ccl022637
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:02:38 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK2cdS019489
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:38 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK2cSQ012290
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:38 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK2cwl026955
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:38 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK2b5c026952
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:02:37 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152002.mBFK2b5c026952@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:02:37 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: threw together xmlschema.py
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:02:39 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xmlschema.py xobj/xobj.py

threw together xmlschema.py

diff -r ebc17a0c41f0 -r d65e075a83b5 xobj/xmlschema.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xobj/xmlschema.py	Fri Dec 05 22:38:55 2008 -0500
@@ -0,0 +1,87 @@
+def smiter(item):
+    if hasattr(item, '__iter__'):
+        return item
+    else:
+        return [ item ]
+
+class AbstractSchemaMember(object):
+
+    pass
+
+class SchemaType(AbstractSchemaMember):
+
+    pass
+
+class EmptyType(SchemaType):
+
+    pass
+
+class StringType(SchemaType):
+
+    pass
+
+class IntegerType(SchemaType):
+
+    pass
+
+class SequenceType(AbstractSchemaMember):
+
+    def __init__(self, xobjSeq):
+        self.elements = [ SchemaElement(x)
+                                for x in smiter(xobjSeq.xsd_element) ]
+
+class Attribute(AbstractSchemaMember):
+
+    def __init__(self, name, xtype):
+        self.name = name
+        self.xtype = xtype
+
+class SchemaElement(AbstractSchemaMember):
+
+    def __init__(self, xobjElement):
+
+        def findSimpleType(typeStr):
+            if typeStr == 'xs:integer':
+                return IntegerType
+            elif typeStr == 'xs:string':
+                return StringType
+
+            return None
+
+        self.name = xobjElement.name
+        self.xtype = None
+        self.attributes = {}
+        attributes = None
+
+        # is this a type?
+        if hasattr(xobjElement, 'xsd_complexType'):
+            xobjType = xobjElement.xsd_complexType
+            attributes = getattr(xobjType, 'xsd_attribute', None)
+            if hasattr(xobjType, 'xsd_sequence'):
+                self.xtype = SequenceType(xobjType.xsd_sequence)
+            else:
+                self.xtype = EmptyType()
+        elif hasattr(xobjElement, 'type'):
+            self.xtype = findSimpleType(xobjElement.type)
+        else:
+            assert(0)
+
+
+        if attributes:
+            for attr in smiter(attributes):
+                self.attributes[attr.name] = Attribute(
+                                        attr.name, findSimpleType(attr.type))
+
+
+class Schema(object):
+
+    def __init__(self, xobjSchema):
+        # xobjSchema is a schema; it's children are global
+
+        # XXX parse global types
+        # XXX parse global attributes
+        self.elements = []
+        for element in smiter(xobjSchema.xsd_element):
+            self.elements.append(SchemaElement(element))
+
+
diff -r ebc17a0c41f0 -r d65e075a83b5 xobj/xobj.py
--- a/xobj/xobj.py	Fri Dec 05 21:55:14 2008 -0500
+++ b/xobj/xobj.py	Fri Dec 05 22:38:55 2008 -0500
@@ -7,6 +7,7 @@
 class XObjParseException(Exception):
 
     pass
+
 
 def smiter(item):
     if hasattr(item, '__iter__'):
@@ -49,7 +50,7 @@
             return element.text
 
         # create a subclass for this type
-        NewClass = type(element.tag + '_XObj_Type', (XObject,), {})
+        NewClass = type(nsmap(element.tag) + '_XObj_Type', (XObject,), {})
         xobj = NewClass()
 
         for (key, val) in element.items():

From johnsonm@rpath.com Mon Dec 15 20:02:49 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK2n5i022643
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:02:49 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK2m8q019505
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:48 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK2mdW012296
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:48 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK2mJi026984
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:48 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK2mUD026982
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:02:48 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152002.mBFK2mUD026982@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:02:48 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: switched xobj to use xmlschema tree instead of directly
	walking the
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:02:49 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xmlschema.py xobj/xobj.py

switched xobj to use xmlschema tree instead of directly walking the
elementtree for the schema

diff -r d65e075a83b5 -r 0ff4a68c4d30 xobj/xmlschema.py
--- a/xobj/xmlschema.py	Fri Dec 05 22:38:55 2008 -0500
+++ b/xobj/xmlschema.py	Fri Dec 05 22:58:19 2008 -0500
@@ -10,7 +10,9 @@
 
 class SchemaType(AbstractSchemaMember):
 
-    pass
+    @staticmethod
+    def fromString(x):
+        return x
 
 class EmptyType(SchemaType):
 
@@ -22,9 +24,18 @@
 
 class IntegerType(SchemaType):
 
-    pass
+    @staticmethod
+    def fromString(x):
+        return int(x)
 
 class SequenceType(AbstractSchemaMember):
+
+    def findElement(self, name):
+        for x in self.elements:
+            if x.name == name:
+                return x
+
+        return None
 
     def __init__(self, xobjSeq):
         self.elements = [ SchemaElement(x)
@@ -32,11 +43,20 @@
 
 class Attribute(AbstractSchemaMember):
 
+    def getType(self):
+        return self.xtype
+
     def __init__(self, name, xtype):
         self.name = name
         self.xtype = xtype
 
 class SchemaElement(AbstractSchemaMember):
+
+    def getType(self):
+        return self.xtype
+
+    def findAttribute(self, name):
+        return self.attributes.get(name, None)
 
     def __init__(self, xobjElement):
 
@@ -73,15 +93,13 @@
                                         attr.name, findSimpleType(attr.type))
 
 
-class Schema(object):
+class Schema(SequenceType):
 
     def __init__(self, xobjSchema):
         # xobjSchema is a schema; it's children are global
 
         # XXX parse global types
         # XXX parse global attributes
-        self.elements = []
-        for element in smiter(xobjSchema.xsd_element):
-            self.elements.append(SchemaElement(element))
+        SequenceType.__init__(self, xobjSchema)
 
 
diff -r d65e075a83b5 -r 0ff4a68c4d30 xobj/xobj.py
--- a/xobj/xobj.py	Fri Dec 05 22:38:55 2008 -0500
+++ b/xobj/xobj.py	Fri Dec 05 22:58:19 2008 -0500
@@ -1,4 +1,5 @@
 from lxml import etree
+import xmlschema
 
 class XObject(object):
 
@@ -15,7 +16,7 @@
     else:
         return [ item ]
 
-def parse(xml, schemaXml = None):
+def parse(xml, schema = None):
 
     def nsmap(s):
         map = { '{http://www.w3.org/2001/XMLSchema}' : 'xsd_' }
@@ -25,26 +26,17 @@
 
         return s
 
-    def flatten(el):
-        if hasattr(el, 'xsd_sequence'):
-            el = el.xsd_sequence
+    def parseElement(element, schema = None):
+        schemaElement = None
+        schemaType = None
+        if schema:
+            schemaElement = schema.findElement(element.tag)
 
-        return el
-
-    def parseElement(element, schemaXObj = None):
-        xsdElement = None
-        if schemaXObj:
-            for e in smiter(schemaXObj.xsd_element):
-                if e.name == element.tag:
-                    xsdElement = e
-                    break
-
-            if not xsdElement:
+            if not schemaElement:
                 raise XObjParseException('element %s not found' %
                                             element.tag)
 
-            if hasattr(xsdElement, 'xsd_complexType'):
-                xsdElement = xsdElement.xsd_complexType
+            schemaType = schemaElement.getType()
 
         if not element.items() and not element.getchildren():
             return element.text
@@ -54,27 +46,22 @@
         xobj = NewClass()
 
         for (key, val) in element.items():
-            if xsdElement:
-                xsdAttribute = None
-                for attr in smiter(xsdElement.xsd_attribute):
-                    if attr.name == key:
-                        xsdAttribute = attr
-                        break
+            if schemaElement:
+                schemaAttribute = schemaElement.findAttribute(key)
 
-                if not xsdAttribute:
+                if not schemaAttribute:
                     raise XObjParseException('attribute %s for element %s not '
                                              'found' % (key, element.tag))
 
-                if hasattr(xsdAttribute, 'type'):
-                    if xsdAttribute.type == 'xs:integer':
-                        val = int(val)
+                val = schemaAttribute.getType().fromString(val)
 
             key = nsmap(key)
             xobj.__setattr__(key, val)
 
         for childElement in element.getchildren():
             tag = nsmap(childElement.tag)
-            child = parseElement(childElement, flatten(xsdElement))
+
+            child = parseElement(childElement, schemaType)
 
             if hasattr(xobj, tag):
                 cur = xobj.__getattribute__(tag)
@@ -87,22 +74,18 @@
 
         return xobj
 
-    if schemaXml:
-        schemaXObj = parse(schemaXml)
-    else:
-        schemaXObj = None
-
-    return parseElement(xml.getroot(), schemaXObj)
+    return parseElement(xml.getroot(), schema)
 
 def parsef(f, schemaf = None):
     if schemaf:
         schemaXml = etree.parse(schemaf)
         schemaXObj = parse(schemaXml)
+        schema = xmlschema.Schema(schemaXObj)
         schemaObj = etree.XMLSchema(schemaXml)
     else:
-        schemaXml = schemaXObj = schemaObj = None
+        schema = schemaXml = schemaXObj = schemaObj = None
 
     parser = etree.XMLParser(schema = schemaObj)
     xml = etree.parse(f, parser)
 
-    return parse(xml, schemaXml = schemaXml)
+    return parse(xml, schema = schema)

From johnsonm@rpath.com Mon Dec 15 20:02:59 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK2xjN022649
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:02:59 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK2xK4019529
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:59 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK2xoU012307
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:59 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK2xQ6027013
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:02:59 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK2wCD027011
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:02:58 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152002.mBFK2wCD027011@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:02:58 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: made nameSpaceMap a parameter to parse
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:02:59 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

made nameSpaceMap a parameter to parse

diff -r 0ff4a68c4d30 -r d90fed7bc123 xobj/xobj.py
--- a/xobj/xobj.py	Fri Dec 05 22:58:19 2008 -0500
+++ b/xobj/xobj.py	Sat Dec 06 19:18:29 2008 -0500
@@ -5,10 +5,13 @@
 
     pass
 
+class XClass(object):
+
+    pass
+
 class XObjParseException(Exception):
 
     pass
-
 
 def smiter(item):
     if hasattr(item, '__iter__'):
@@ -16,11 +19,10 @@
     else:
         return [ item ]
 
-def parse(xml, schema = None):
+def parse(xml, schema = None, nameSpaceMap = {}):
 
     def nsmap(s):
-        map = { '{http://www.w3.org/2001/XMLSchema}' : 'xsd_' }
-        for key, val in map.iteritems():
+        for key, val in nameSpaceMap.iteritems():
             if s.startswith(key):
                 s = s.replace(key, val)
 
@@ -79,7 +81,8 @@
 def parsef(f, schemaf = None):
     if schemaf:
         schemaXml = etree.parse(schemaf)
-        schemaXObj = parse(schemaXml)
+        schemaXObj = parse(schemaXml, nameSpaceMap = 
+                           { '{http://www.w3.org/2001/XMLSchema}' : 'xsd_' })
         schema = xmlschema.Schema(schemaXObj)
         schemaObj = etree.XMLSchema(schemaXml)
     else:

From johnsonm@rpath.com Mon Dec 15 20:03:10 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK3ApN022655
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:03:10 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK3A7m019538
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:10 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK39Yj012319
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:10 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK39vX027042
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:09 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK39rQ027040
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:03:09 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152003.mBFK39rQ027040@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:03:09 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: replace schema walk with XObject schema walk
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:03:10 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

replace schema walk with XObject schema walk

diff -r d90fed7bc123 -r f0819d3ae150 xobj/xobj.py
--- a/xobj/xobj.py	Sat Dec 06 19:18:29 2008 -0500
+++ b/xobj/xobj.py	Sat Dec 06 20:20:12 2008 -0500
@@ -1,13 +1,23 @@
 from lxml import etree
 import xmlschema
+import types
 
 class XObject(object):
 
-    pass
+    def _setElement(self, key, val):
+        expectedType = getattr(self.__class__, key, None)
 
-class XClass(object):
-
-    pass
+        current = getattr(self, key, None)
+        if current is None:
+            setattr(self, key, val)
+        elif current == int:
+            setattr(self, key, int(val))
+        elif current == expectedType:
+            setattr(self, key, val)
+        elif type(current) == list:
+            current.append(val)
+        else:
+            setattr(self, key, [ current, val ])
 
 class XObjParseException(Exception):
 
@@ -19,7 +29,7 @@
     else:
         return [ item ]
 
-def parse(xml, schema = None, nameSpaceMap = {}):
+def parse(xml, rootXClass = None, nameSpaceMap = {}):
 
     def nsmap(s):
         for key, val in nameSpaceMap.iteritems():
@@ -28,57 +38,45 @@
 
         return s
 
-    def parseElement(element, schema = None):
-        schemaElement = None
-        schemaType = None
-        if schema:
-            schemaElement = schema.findElement(element.tag)
-
-            if not schemaElement:
-                raise XObjParseException('element %s not found' %
-                                            element.tag)
-
-            schemaType = schemaElement.getType()
-
+    def parseElement(element, xClass = None):
         if not element.items() and not element.getchildren():
             return element.text
 
         # create a subclass for this type
-        NewClass = type(nsmap(element.tag) + '_XObj_Type', (XObject,), {})
-        xobj = NewClass()
+        if xClass:
+            xobj = xClass()
+        else:
+            localTag = nsmap(element.tag)
+            NewClass = type(localTag + '_XObj_Type', (XObject,), {})
+            xobj = NewClass()
 
         for (key, val) in element.items():
-            if schemaElement:
-                schemaAttribute = schemaElement.findAttribute(key)
-
-                if not schemaAttribute:
-                    raise XObjParseException('attribute %s for element %s not '
-                                             'found' % (key, element.tag))
-
-                val = schemaAttribute.getType().fromString(val)
-
             key = nsmap(key)
-            xobj.__setattr__(key, val)
+            xobj._setElement(key, val)
 
         for childElement in element.getchildren():
+            if types.BuiltinFunctionType == type(childElement.tag):
+                # this catches comments. this is ugly.
+                continue
+
             tag = nsmap(childElement.tag)
+            childType = getattr(xClass, tag, None)
+            child = parseElement(childElement, xClass = childType)
+            xobj._setElement(tag, child)
 
-            child = parseElement(childElement, schemaType)
-
-            if hasattr(xobj, tag):
-                cur = xobj.__getattribute__(tag)
-                if type(cur) == list:
-                    cur.append(child)
-                else:
-                    xobj.__setattr__(tag, [ cur, child ])
-            else:
-                xobj.__setattr__(tag, child)
+        # anything which is the same as in the class wasn't set in XML, so
+        # set it to None
+        for key, val in xobj.__class__.__dict__.items():
+            if key[0] == '_': continue
+            if getattr(xobj, key) == val:
+                setattr(xobj, key, None)
 
         return xobj
 
-    return parseElement(xml.getroot(), schema)
+    return parseElement(xml.getroot(), xClass = rootXClass)
 
-def parsef(f, schemaf = None):
+def parsef(f, rootXClass = None, nameSpaceMap = {}):
+    schemaf = None
     if schemaf:
         schemaXml = etree.parse(schemaf)
         schemaXObj = parse(schemaXml, nameSpaceMap = 
@@ -91,4 +89,4 @@
     parser = etree.XMLParser(schema = schemaObj)
     xml = etree.parse(f, parser)
 
-    return parse(xml, schema = schema)
+    return parse(xml, rootXClass = rootXClass, nameSpaceMap = nameSpaceMap)

From johnsonm@rpath.com Mon Dec 15 20:03:21 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK3LZY022661
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:03:21 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK3KgO019548
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:20 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK3KjU012325
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:20 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK3K1O027071
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:20 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK3Kjl027069
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:03:20 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152003.mBFK3Kjl027069@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:03:20 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: added XType support
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:03:21 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

added XType support

diff -r f0819d3ae150 -r 5ff0c2854827 xobj/xobj.py
--- a/xobj/xobj.py	Sat Dec 06 20:20:12 2008 -0500
+++ b/xobj/xobj.py	Sun Dec 07 10:25:30 2008 -0500
@@ -1,18 +1,53 @@
 from lxml import etree
 import xmlschema
 import types
+
+class UnknownXType(Exception):
+
+    pass
+
+class XType(object):
+
+    def __init__(self, pythonType, forceList = False):
+        self.pythonType = pythonType
+        self.forceList = forceList
+
+def XTypeFromXObjectType(xObjectType):
+
+    if (type(xObjectType) == type and
+            issubclass(xObjectType, XObject)):
+        return XType(xObjectType)
+    elif issubclass(xObjectType.__class__, XType):
+        return XType
+    elif xObjectType in (int, str):
+        return XType(xObjectType)
+    elif type(xObjectType) == list:
+        assert(len(xObjectType) == 1)
+        return XType(XTypeFromXObjectType(xObjectType[0]).pythonType,
+                     forceList = True)
+
+    raise UnknownXType
 
 class XObject(object):
 
     def _setElement(self, key, val):
         expectedType = getattr(self.__class__, key, None)
+        current = getattr(self, key, None)
+        if expectedType:
+            expectedXType = XTypeFromXObjectType(expectedType)
 
-        current = getattr(self, key, None)
-        if current is None:
-            setattr(self, key, val)
-        elif current == int:
-            setattr(self, key, int(val))
-        elif current == expectedType:
+            if expectedXType.forceList:
+                # force the item to be a list, and use the type inside of
+                # this list as the type of elements of the list
+                if id(current) == id(expectedType):
+                    current = []
+                    setattr(self, key, current)
+
+            if expectedXType.pythonType == int:
+                val = int(val)
+
+        if id(current) == id(expectedType):
+            # This has not yet been set in the instance.
             setattr(self, key, val)
         elif type(current) == list:
             current.append(val)
@@ -61,6 +96,9 @@
 
             tag = nsmap(childElement.tag)
             childType = getattr(xClass, tag, None)
+            if childType:
+                import epdb;epdb.st()
+                childType = XTypeFromXObjectType(childType).pythonType
             child = parseElement(childElement, xClass = childType)
             xobj._setElement(tag, child)
 

From johnsonm@rpath.com Mon Dec 15 20:03:31 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK3V7f022669
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:03:31 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK3VJ8019557
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:31 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK3VRD012332
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:31 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK3VuM027100
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:31 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK3Urm027098
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:03:30 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152003.mBFK3Urm027098@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:03:30 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: handle text elements properly, inherit all data items
	from XObject, split
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:03:31 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

handle text elements properly, inherit all data items from XObject, split
attribute/element handling

diff -r 5ff0c2854827 -r 5886873221f4 xobj/xobj.py
--- a/xobj/xobj.py	Sun Dec 07 10:25:30 2008 -0500
+++ b/xobj/xobj.py	Mon Dec 08 12:36:40 2008 -0500
@@ -19,8 +19,10 @@
         return XType(xObjectType)
     elif issubclass(xObjectType.__class__, XType):
         return XType
-    elif xObjectType in (int, str):
-        return XType(xObjectType)
+    elif xObjectType == int:
+        return XType(XObjectInt)
+    elif xObjectType == str:
+        return XType(str)
     elif type(xObjectType) == list:
         assert(len(xObjectType) == 1)
         return XType(XTypeFromXObjectType(xObjectType[0]).pythonType,
@@ -30,29 +32,44 @@
 
 class XObject(object):
 
-    def _setElement(self, key, val):
+    def _setAttribute(self, key, val):
         expectedType = getattr(self.__class__, key, None)
-        current = getattr(self, key, None)
         if expectedType:
             expectedXType = XTypeFromXObjectType(expectedType)
+            val = expectedXType.pythonType(val)
+        else:
+            expectedXType = None
+            val = XObjectStr(val)
 
-            if expectedXType.forceList:
-                # force the item to be a list, and use the type inside of
-                # this list as the type of elements of the list
-                if id(current) == id(expectedType):
-                    current = []
-                    setattr(self, key, current)
+        self._setItem(key, val, expectedXType)
 
-            if expectedXType.pythonType == int:
-                val = int(val)
+    def _setItem(self, key, val, xType = None):
+        current = getattr(self, key, None)
+        if xType and xType.forceList:
+            # force the item to be a list, and use the type inside of
+            # this list as the type of elements of the list
+            if id(current) == id(xType):
+                current = []
+                setattr(self, key, current)
 
-        if id(current) == id(expectedType):
+        if key not in self.__dict__:
             # This has not yet been set in the instance.
             setattr(self, key, val)
         elif type(current) == list:
             current.append(val)
         else:
             setattr(self, key, [ current, val ])
+
+    def __init__(self, text):
+        self.text = text
+
+class XObjectInt(XObject, int):
+
+    pass
+
+class XObjectStr(XObject, str):
+
+    pass
 
 class XObjParseException(Exception):
 
@@ -74,21 +91,16 @@
         return s
 
     def parseElement(element, xClass = None):
-        if not element.items() and not element.getchildren():
-            return element.text
-
-        # create a subclass for this type
+        # handle the text for this tag
         if xClass:
-            xobj = xClass()
+            xobj = xClass(element.text)
         else:
             localTag = nsmap(element.tag)
-            NewClass = type(localTag + '_XObj_Type', (XObject,), {})
-            xobj = NewClass()
+            # create a subclass for this type
+            NewClass = type(localTag + '_XObj_Type', (XObjectStr,), {})
+            xobj = NewClass(element.text)
 
-        for (key, val) in element.items():
-            key = nsmap(key)
-            xobj._setElement(key, val)
-
+        # handle children
         for childElement in element.getchildren():
             if types.BuiltinFunctionType == type(childElement.tag):
                 # this catches comments. this is ugly.
@@ -97,10 +109,18 @@
             tag = nsmap(childElement.tag)
             childType = getattr(xClass, tag, None)
             if childType:
-                import epdb;epdb.st()
-                childType = XTypeFromXObjectType(childType).pythonType
+                #import epdb;epdb.st()
+                childXType = XTypeFromXObjectType(childType)
+            else:
+                childXType = None
+
             child = parseElement(childElement, xClass = childType)
-            xobj._setElement(tag, child)
+            xobj._setItem(tag, child, childXType)
+
+        # handle attributes
+        for (key, val) in element.items():
+            key = nsmap(key)
+            xobj._setAttribute(key, val)
 
         # anything which is the same as in the class wasn't set in XML, so
         # set it to None

From johnsonm@rpath.com Mon Dec 15 20:03:42 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK3gOD022675
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:03:42 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK3gpa019570
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:42 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK3f1h012339
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:42 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK3f55027130
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:41 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK3fdI027128
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:03:41 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152003.mBFK3fdI027128@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:03:41 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: parseElement() takes an XType, not a python type
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:03:42 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

parseElement() takes an XType, not a python type

diff -r 5886873221f4 -r ad43b4d76179 xobj/xobj.py
--- a/xobj/xobj.py	Mon Dec 08 12:36:40 2008 -0500
+++ b/xobj/xobj.py	Mon Dec 08 13:46:01 2008 -0500
@@ -48,7 +48,7 @@
         if xType and xType.forceList:
             # force the item to be a list, and use the type inside of
             # this list as the type of elements of the list
-            if id(current) == id(xType):
+            if key not in self.__dict__:
                 current = []
                 setattr(self, key, current)
 
@@ -90,10 +90,10 @@
 
         return s
 
-    def parseElement(element, xClass = None):
+    def parseElement(element, xType = None):
         # handle the text for this tag
-        if xClass:
-            xobj = xClass(element.text)
+        if xType:
+            xobj = xType.pythonType(element.text)
         else:
             localTag = nsmap(element.tag)
             # create a subclass for this type
@@ -107,14 +107,14 @@
                 continue
 
             tag = nsmap(childElement.tag)
-            childType = getattr(xClass, tag, None)
-            if childType:
-                #import epdb;epdb.st()
-                childXType = XTypeFromXObjectType(childType)
-            else:
-                childXType = None
 
-            child = parseElement(childElement, xClass = childType)
+            childXType = None
+            if xType:
+                childType = getattr(xType.pythonType, tag, None)
+                if childType:
+                    childXType = XTypeFromXObjectType(childType)
+
+            child = parseElement(childElement, xType = childXType)
             xobj._setItem(tag, child, childXType)
 
         # handle attributes
@@ -131,7 +131,12 @@
 
         return xobj
 
-    return parseElement(xml.getroot(), xClass = rootXClass)
+    if rootXClass:
+        rootXType = XTypeFromXObjectType(rootXClass)
+    else:
+        rootXType = None
+
+    return parseElement(xml.getroot(), xType = rootXType)
 
 def parsef(f, rootXClass = None, nameSpaceMap = {}):
     schemaf = None

From johnsonm@rpath.com Mon Dec 15 20:03:52 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK3qGf022681
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:03:52 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK3qXV019586
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:52 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK3qaf012348
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:52 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK3qIH027160
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:03:52 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK3qdi027158
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:03:52 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152003.mBFK3qdi027158@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:03:52 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: complex types don't get text values
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:03:53 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

complex types don't get text values

diff -r ad43b4d76179 -r 0806d002170c xobj/xobj.py
--- a/xobj/xobj.py	Mon Dec 08 13:46:01 2008 -0500
+++ b/xobj/xobj.py	Mon Dec 08 13:57:25 2008 -0500
@@ -42,6 +42,15 @@
             val = XObjectStr(val)
 
         self._setItem(key, val, expectedXType)
+
+    def _isComplex(self):
+        complex = False
+        for key in xType.pythonType.__dict__.iterkeys():
+            if key[0] != '_':
+                complex = True
+                break
+
+        return False
 
     def _setItem(self, key, val, xType = None):
         current = getattr(self, key, None)
@@ -92,13 +101,25 @@
 
     def parseElement(element, xType = None):
         # handle the text for this tag
+        if element.getchildren():
+            text = None
+        else:
+            text = element.text
+
         if xType:
-            xobj = xType.pythonType(element.text)
+            if text:
+                if xType.isComplex():
+                    text = None
+
+            xobj = xType.pythonType(text)
         else:
             localTag = nsmap(element.tag)
             # create a subclass for this type
-            NewClass = type(localTag + '_XObj_Type', (XObjectStr,), {})
-            xobj = NewClass(element.text)
+            if text is None:
+                NewClass = type(localTag + '_XObj_Type', (XObject,), {})
+            else:
+                NewClass = type(localTag + '_XObj_Type', (XObjectStr,), {})
+            xobj = NewClass(text)
 
         # handle children
         for childElement in element.getchildren():

From johnsonm@rpath.com Mon Dec 15 20:04:03 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK433L022687
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:04:03 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK43mJ019608
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:03 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK43wA012403
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:03 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK42b3027189
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:02 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK42Oj027187
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:04:02 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152004.mBFK42Oj027187@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:04:02 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: wrote basic tostring()
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:04:03 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

wrote basic tostring()

diff -r 0806d002170c -r bd275e8dd83e xobj/xobj.py
--- a/xobj/xobj.py	Mon Dec 08 13:57:25 2008 -0500
+++ b/xobj/xobj.py	Mon Dec 08 14:32:58 2008 -0500
@@ -41,6 +41,8 @@
             expectedXType = None
             val = XObjectStr(val)
 
+        val._isattr = True
+
         self._setItem(key, val, expectedXType)
 
     def _isComplex(self):
@@ -68,6 +70,33 @@
             current.append(val)
         else:
             setattr(self, key, [ current, val ])
+
+    def getElementTree(self, tag, rootElement = None):
+        attrs = {}
+        elements = {}
+        for key, val in self.__dict__.iteritems():
+            if isinstance(val, XObject):
+                if getattr(val, '_isattr', False):
+                    attrs[key] = str(val)
+                else:
+                    elements[key] = val
+
+        if rootElement is None:
+            element = etree.Element(tag, attrs)
+        else:
+            element = etree.SubElement(rootElement, tag, attrs)
+
+        if self.text is not None:
+            element.text = self.text
+
+        for key, val in elements.iteritems():
+            val.getElementTree(key, rootElement = element)
+
+        return element
+
+    def tostring(self):
+        et = self.getElementTree('top')
+        return etree.tostring(et, pretty_print = True, encoding = 'UTF-8')
 
     def __init__(self, text):
         self.text = text

From johnsonm@rpath.com Mon Dec 15 20:04:14 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK4EQ3022693
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:04:14 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK4Dsn019617
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:13 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK4D3L012410
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:13 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK4DkM027218
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:13 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK4D6F027216
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:04:13 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152004.mBFK4D6F027216@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:04:13 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: order elements on write; base it on the order we read
	unless an explicit
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:04:14 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

order elements on write; base it on the order we read unless an explicit
order is given

diff -r bd275e8dd83e -r 06913264bede xobj/xobj.py
--- a/xobj/xobj.py	Mon Dec 08 14:32:58 2008 -0500
+++ b/xobj/xobj.py	Mon Dec 08 17:59:18 2008 -0500
@@ -32,6 +32,17 @@
 
 class XObject(object):
 
+    _elementOrder = None
+
+    def _isComplex(self):
+        complex = False
+        for key in xType.pythonType.__dict__.iterkeys():
+            if key[0] != '_':
+                complex = True
+                break
+
+        return False
+
     def _setAttribute(self, key, val):
         expectedType = getattr(self.__class__, key, None)
         if expectedType:
@@ -45,14 +56,12 @@
 
         self._setItem(key, val, expectedXType)
 
-    def _isComplex(self):
-        complex = False
-        for key in xType.pythonType.__dict__.iterkeys():
-            if key[0] != '_':
-                complex = True
-                break
-
-        return False
+    def _addElement(self, key, val, xType = None):
+        self._setItem(key, val, xType = xType)
+        if self._elementOrder is None:
+            self._elementOrder = [ key ]
+        elif key not in self._elementOrder:
+            self._elementOrder.append(key)
 
     def _setItem(self, key, val, xType = None):
         current = getattr(self, key, None)
@@ -79,7 +88,17 @@
                 if getattr(val, '_isattr', False):
                     attrs[key] = str(val)
                 else:
-                    elements[key] = val
+                    l = elements.setdefault(key, [])
+                    l.append(val)
+
+        orderedElements = []
+        if self._elementOrder:
+            for name in self._elementOrder:
+                for val in elements[name]:
+                    orderedElements.append((name, val))
+            for name in (set(elements) - set(self._elementOrder)):
+                for val in elements[name]:
+                    orderedElements.append((name, val))
 
         if rootElement is None:
             element = etree.Element(tag, attrs)
@@ -89,7 +108,7 @@
         if self.text is not None:
             element.text = self.text
 
-        for key, val in elements.iteritems():
+        for key, val in orderedElements:
             val.getElementTree(key, rootElement = element)
 
         return element
@@ -165,7 +184,7 @@
                     childXType = XTypeFromXObjectType(childType)
 
             child = parseElement(childElement, xType = childXType)
-            xobj._setItem(tag, child, childXType)
+            xobj._addElement(tag, child, childXType)
 
         # handle attributes
         for (key, val) in element.items():

From johnsonm@rpath.com Mon Dec 15 20:04:24 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK4OXN022703
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:04:24 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK4OtS019632
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:24 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK4ObJ012417
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:24 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK4Ock027247
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:24 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK4NoQ027245
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:04:23 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152004.mBFK4NoQ027245@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:04:23 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: cleanups for ordered writing
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:04:25 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

cleanups for ordered writing

diff -r 06913264bede -r a86e5e064c06 xobj/xobj.py
--- a/xobj/xobj.py	Mon Dec 08 17:59:18 2008 -0500
+++ b/xobj/xobj.py	Mon Dec 08 18:20:38 2008 -0500
@@ -84,7 +84,7 @@
         attrs = {}
         elements = {}
         for key, val in self.__dict__.iteritems():
-            if isinstance(val, XObject):
+            if key[0] != '_':
                 if getattr(val, '_isattr', False):
                     attrs[key] = str(val)
                 else:
@@ -109,7 +109,12 @@
             element.text = self.text
 
         for key, val in orderedElements:
-            val.getElementTree(key, rootElement = element)
+            if val is not None:
+                if type(val) == list:
+                    for subval in val:
+                        subval.getElementTree(key, rootElement = element)
+                else:
+                    val.getElementTree(key, rootElement = element)
 
         return element
 

From johnsonm@rpath.com Mon Dec 15 20:04:35 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK4ZlX022711
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:04:35 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK4Z6H019638
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:35 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK4YOl012422
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:35 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK4YFG027276
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:34 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK4YFJ027274
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:04:34 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152004.mBFK4YFJ027274@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:04:34 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: added test infrastructure and basic test case
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:04:35 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/Makefile test/bootstrap.py test/testsuite.py test/xobjtest.py

added test infrastructure and basic test case

diff -r a86e5e064c06 -r 325906f9501a test/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/Makefile	Tue Dec 09 20:09:38 2008 -0500
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2004-2006 rPath, Inc.
+# All rights reserved
+#
+
+SUBDIRS=
+
+.PHONY: clean test debug-test
+
+dist_files = *.py Makefile archive/*
+
+all:
+	for dir in `find . -type d -name '*test' | fgrep -v .hg`; do \
+relativelink=`echo "$$dir" | sed s,/[^/]*,/..,g | sed 's,./,,'`; \
+ln -fs $${relativelink}/testsetup.py $$dir; \
+done
+
+install:
+	echo "nothing to install"
+
+test:
+	python2.4 testsuite.py
+
+debug-test:
+	python2.4 testsuite.py --debug
+
+clean: clean-coverage
+	@find . \( -name \*~ -o -name \*.pyc \) -exec rm -fv {} \;
+	for dir in `find . -type d -name '*test'`; do \
+            rm -f $${dir}/testsetup.py*;\
+        done
+
+clean-coverage:
+	@find . \( -name \*,cover \) -exec rm -fv {} \;
+	@rm -rf .coverage
+
diff -r a86e5e064c06 -r 325906f9501a test/bootstrap.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/bootstrap.py	Tue Dec 09 20:09:38 2008 -0500
@@ -0,0 +1,11 @@
+import os
+import sys
+
+testUtilDir = os.environ.get('TESTUTILS_PATH', '../testutils')
+if os.path.exists(testUtilDir):
+    sys.path.insert(0, testUtilDir)
+
+try:
+    import testrunner
+except ImportError:
+    raise RuntimeError('Could not find testrunner - set TESTUTILS_PATH')
diff -r a86e5e064c06 -r 325906f9501a test/testsuite.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/testsuite.py	Tue Dec 09 20:09:38 2008 -0500
@@ -0,0 +1,82 @@
+#!/usr/bin/python
+# -*- mode: python -*-
+#
+# Copyright (c) 2004-2008 rPath, Inc.
+#
+import os
+import sys
+import unittest
+
+import bootstrap
+from testrunner import testhelp
+from testrunner import resources, testhandler
+
+#from pychecker import checker
+
+_setupPath = None
+
+def setup():
+    """
+    Setup initializes variables must be initialized before the testsuite
+    can be run.  Generally this means setting up and determining paths.
+    """
+    global _setupPath
+    if _setupPath:
+        return _setupPath
+
+    xobjPath = testhelp.getPath('XOBJ_PATH')
+    os.environ['XOBJ_PATH'] = xobjPath
+    for path in xobjPath.split(':'):
+        if not os.path.isdir(path):
+            print 'XOBJ_PATH %s does not exist' %path
+            sys.exit(1)
+    testhelp.insertPath(testhelp.getPath('XOBJ_PATH'), updatePythonPath=True)
+
+    from testrunner import testSetup
+    testSetup.setup()
+
+    from conary.lib import util
+    sys.excepthook = util.genExcepthook(True, catchSIGUSR1=False)
+
+    testhelp._conaryDir = resources.conaryDir
+    _setupPath = path
+    return path
+
+def main(argv=None, individual=True):
+    cfg = resources.cfg
+    cfg.isIndividual = individual
+
+    setup()
+
+    cfg.cleanTestDirs = not individual
+    cfg.coverageExclusions = ['scripts/.*', 'epdb.py', 'stackutil.py']
+    cfg.coverageDirs = [ os.environ['XOBJ_PATH'] ]
+
+    if argv is None:
+        argv = list(sys.argv)
+    topdir = testhelp.getTestPath()
+    if topdir not in sys.path:
+        sys.path.insert(0, topdir)
+    cwd = os.getcwd()
+    if cwd != topdir and cwd not in sys.path:
+        sys.path.insert(0, cwd)
+
+
+
+    from conary.lib import util
+    from conary.lib import coveragehook
+    sys.excepthook = util.genExcepthook(True, catchSIGUSR1=False)
+
+    handler = testhandler.TestSuiteHandler(cfg, resources)
+    print "This process PID:", os.getpid()
+    results = handler.main(argv)
+    if results is None:
+        sys.exit(0)
+    sys.exit(not results.wasSuccessful())
+
+if __name__ == '__main__':
+    testDir = os.path.dirname(__file__)
+    if not os.path.exists(testDir + '/conarytest/testsetup.py'):
+        print "Executing makefile to create required symlinks..."
+        os.system('make')
+    main(sys.argv, individual=False)
diff -r a86e5e064c06 -r 325906f9501a test/xobjtest.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/xobjtest.py	Tue Dec 09 20:09:38 2008 -0500
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+
+import testsuite
+testsuite.setup()
+from testrunner import testhelp
+
+from xobj import xobj
+from StringIO import StringIO
+
+class XobjTest(testhelp.TestCase):
+
+    def testSimpleParse(self):
+        xml = StringIO('<top attr="anattr">\n'
+                       '    <!-- comment -->'
+                       '    <prop>something</prop>\n'
+                       '    <subelement subattr="2"/>\n'
+                       '    </top>\n')
+        o = xobj.parsef(xml)
+        self.assertEqual(o.__class__.__name__, 'top_XObj_Type')
+        self.assertEqual(o.attr, 'anattr')
+        self.assertEqual(o.prop, 'something')
+        self.assertEqual(o.subelement.subattr, '2')
+
+        # ---
+
+        class SubelementClass(xobj.XObject):
+            subattr = int
+
+        class TopClass(xobj.XObject):
+            subelement = SubelementClass
+            unused = str
+
+        o = xobj.parsef(xml, rootXClass = TopClass)
+        self.assertEqual(o.subelement.subattr, 2)
+        self.assertEqual(o.unused, None)
+
+        # ---
+
+        class SubelementClass(xobj.XObject):
+            subattr = [ int ]
+        TopClass.subelement = SubelementClass
+
+        o = xobj.parsef(xml, rootXClass = TopClass)
+        self.assertEqual(o.subelement.subattr, [ 2 ] )
+
+        # ---
+
+        TopClass.subelement = [ SubelementClass ]
+        o = xobj.parsef(xml, rootXClass = TopClass)
+        self.assertEqual(o.subelement[0].subattr, [ 2] )
+
+
+if __name__ == "__main__":
+    testsuite.main()

From johnsonm@rpath.com Mon Dec 15 20:04:46 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK4klL022717
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:04:46 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK4jbv019648
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:45 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK4jgC012429
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:45 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK4jSF027306
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:45 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK4jNA027304
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:04:45 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152004.mBFK4jNA027304@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:04:45 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: 1. removed unneeded smiter()
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:04:46 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

1. removed unneeded smiter()
2. worked on namespace support in tostring()

diff -r 325906f9501a -r 811f07ff90b3 xobj/xobj.py
--- a/xobj/xobj.py	Tue Dec 09 20:09:38 2008 -0500
+++ b/xobj/xobj.py	Tue Dec 09 20:11:25 2008 -0500
@@ -80,12 +80,24 @@
         else:
             setattr(self, key, [ current, val ])
 
-    def getElementTree(self, tag, rootElement = None):
+    def getElementTree(self, tag, rootElement = None, nsmap = {},
+                       rewriteMap = {}):
+        def addns(s):
+            for key, val in rewriteMap.iteritems():
+                if s.startswith(key + '_'):
+                    s = s.replace(key + '_', val)
+
+            return s
+
         attrs = {}
         elements = {}
         for key, val in self.__dict__.iteritems():
             if key[0] != '_':
                 if getattr(val, '_isattr', False):
+                    #if key.startswith('ovf_size'):
+                        #import epdb;epdb.st()
+                    key = addns(key)
+                    print key
                     attrs[key] = str(val)
                 else:
                     l = elements.setdefault(key, [])
@@ -101,7 +113,7 @@
                     orderedElements.append((name, val))
 
         if rootElement is None:
-            element = etree.Element(tag, attrs)
+            element = etree.Element(tag, attrs, nsmap = nsmap)
         else:
             element = etree.SubElement(rootElement, tag, attrs)
 
@@ -110,16 +122,23 @@
 
         for key, val in orderedElements:
             if val is not None:
+                key = addns(key)
                 if type(val) == list:
                     for subval in val:
-                        subval.getElementTree(key, rootElement = element)
+                        subval.getElementTree(key, rootElement = element,
+                                              rewriteMap = rewriteMap)
                 else:
-                    val.getElementTree(key, rootElement = element)
+                    val.getElementTree(key, rootElement = element,
+                                       rewriteMap = rewriteMap)
 
         return element
 
-    def tostring(self):
-        et = self.getElementTree('top')
+    def tostring(self, nsmap = {}):
+        foo = dict(self._nsmap)
+        import epdb;epdb.st()
+        foo['ovf'] = 'http://schemas.dmtf.org/ovf/envelope/1'
+        et = self.getElementTree('top', nsmap = foo,
+                                 rewriteMap = nsmap)
         return etree.tostring(et, pretty_print = True, encoding = 'UTF-8')
 
     def __init__(self, text):
@@ -137,18 +156,12 @@
 
     pass
 
-def smiter(item):
-    if hasattr(item, '__iter__'):
-        return item
-    else:
-        return [ item ]
-
 def parse(xml, rootXClass = None, nameSpaceMap = {}):
 
     def nsmap(s):
         for key, val in nameSpaceMap.iteritems():
             if s.startswith(key):
-                s = s.replace(key, val)
+                s = s.replace(key, val + '_')
 
         return s
 
@@ -210,7 +223,9 @@
     else:
         rootXType = None
 
-    return parseElement(xml.getroot(), xType = rootXType)
+    topElement = parseElement(xml.getroot(), xType = rootXType)
+    topElement._nsmap = xml.getroot().nsmap
+    return topElement
 
 def parsef(f, rootXClass = None, nameSpaceMap = {}):
     schemaf = None

From johnsonm@rpath.com Mon Dec 15 20:04:57 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK4vPa022723
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:04:57 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK4ucm019656
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:56 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK4uvt012438
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:56 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK4ukj027336
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:04:56 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK4tAs027334
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:04:55 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152004.mBFK4tAs027334@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:04:55 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: use an XRootObject for the top level wrapper object
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:04:57 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

use an XRootObject for the top level wrapper object

diff -r 811f07ff90b3 -r 47b59f381603 test/xobjtest.py
--- a/test/xobjtest.py	Tue Dec 09 20:11:25 2008 -0500
+++ b/test/xobjtest.py	Tue Dec 09 20:35:54 2008 -0500
@@ -16,10 +16,10 @@
                        '    <subelement subattr="2"/>\n'
                        '    </top>\n')
         o = xobj.parsef(xml)
-        self.assertEqual(o.__class__.__name__, 'top_XObj_Type')
-        self.assertEqual(o.attr, 'anattr')
-        self.assertEqual(o.prop, 'something')
-        self.assertEqual(o.subelement.subattr, '2')
+        self.assertEqual(o.top.__class__.__name__, 'top_XObj_Type')
+        self.assertEqual(o.top.attr, 'anattr')
+        self.assertEqual(o.top.prop, 'something')
+        self.assertEqual(o.top.subelement.subattr, '2')
 
         # ---
 
@@ -31,8 +31,8 @@
             unused = str
 
         o = xobj.parsef(xml, rootXClass = TopClass)
-        self.assertEqual(o.subelement.subattr, 2)
-        self.assertEqual(o.unused, None)
+        self.assertEqual(o.top.subelement.subattr, 2)
+        self.assertEqual(o.top.unused, None)
 
         # ---
 
@@ -41,13 +41,13 @@
         TopClass.subelement = SubelementClass
 
         o = xobj.parsef(xml, rootXClass = TopClass)
-        self.assertEqual(o.subelement.subattr, [ 2 ] )
+        self.assertEqual(o.top.subelement.subattr, [ 2 ] )
 
         # ---
 
         TopClass.subelement = [ SubelementClass ]
         o = xobj.parsef(xml, rootXClass = TopClass)
-        self.assertEqual(o.subelement[0].subattr, [ 2] )
+        self.assertEqual(o.top.subelement[0].subattr, [ 2] )
 
 
 if __name__ == "__main__":
diff -r 811f07ff90b3 -r 47b59f381603 xobj/xobj.py
--- a/xobj/xobj.py	Tue Dec 09 20:11:25 2008 -0500
+++ b/xobj/xobj.py	Tue Dec 09 20:35:54 2008 -0500
@@ -97,7 +97,6 @@
                     #if key.startswith('ovf_size'):
                         #import epdb;epdb.st()
                     key = addns(key)
-                    print key
                     attrs[key] = str(val)
                 else:
                     l = elements.setdefault(key, [])
@@ -133,16 +132,21 @@
 
         return element
 
+    def __init__(self, text = None):
+        self.text = text
+
+class RootXObject(XObject):
+
     def tostring(self, nsmap = {}):
         foo = dict(self._nsmap)
-        import epdb;epdb.st()
         foo['ovf'] = 'http://schemas.dmtf.org/ovf/envelope/1'
-        et = self.getElementTree('top', nsmap = foo,
+        for key, val in self.__dict__.iteritems():
+            if isinstance(val, XObject):
+                break
+
+        et = val.getElementTree(key, nsmap = foo,
                                  rewriteMap = nsmap)
         return etree.tostring(et, pretty_print = True, encoding = 'UTF-8')
-
-    def __init__(self, text):
-        self.text = text
 
 class XObjectInt(XObject, int):
 
@@ -165,19 +169,33 @@
 
         return s
 
-    def parseElement(element, xType = None):
+    def parseElement(element, parentXType = None, parentXObj = None):
         # handle the text for this tag
         if element.getchildren():
             text = None
         else:
             text = element.text
 
-        if xType:
+        tag = nsmap(element.tag)
+
+        thisXType = None
+        if isinstance(parentXObj, RootXObject):
+            # This handles the root element where the parentXType is
+            # really the XType for the root.
+            if parentXType:
+                thisPyType = parentXType.pythonType
+                thisXType = XTypeFromXObjectType(thisPyType)
+        elif parentXType:
+            thisPyType = getattr(parentXType.pythonType, tag, None)
+            if thisPyType:
+                thisXType = XTypeFromXObjectType(thisPyType)
+
+        if thisXType:
             if text:
-                if xType.isComplex():
+                if thisXType.isComplex():
                     text = None
 
-            xobj = xType.pythonType(text)
+            xobj = thisXType.pythonType(text)
         else:
             localTag = nsmap(element.tag)
             # create a subclass for this type
@@ -192,17 +210,8 @@
             if types.BuiltinFunctionType == type(childElement.tag):
                 # this catches comments. this is ugly.
                 continue
-
-            tag = nsmap(childElement.tag)
-
-            childXType = None
-            if xType:
-                childType = getattr(xType.pythonType, tag, None)
-                if childType:
-                    childXType = XTypeFromXObjectType(childType)
-
-            child = parseElement(childElement, xType = childXType)
-            xobj._addElement(tag, child, childXType)
+            child = parseElement(childElement, parentXType = thisXType,
+                                 parentXObj = xobj)
 
         # handle attributes
         for (key, val) in element.items():
@@ -216,6 +225,9 @@
             if getattr(xobj, key) == val:
                 setattr(xobj, key, None)
 
+        if parentXObj is not None:
+            parentXObj._addElement(tag, xobj, thisXType)
+
         return xobj
 
     if rootXClass:
@@ -223,9 +235,11 @@
     else:
         rootXType = None
 
-    topElement = parseElement(xml.getroot(), xType = rootXType)
-    topElement._nsmap = xml.getroot().nsmap
-    return topElement
+    topXObj = RootXObject()
+    parseElement(xml.getroot(), parentXType = rootXType,
+                 parentXObj = topXObj)
+    topXObj._nsmap = xml.getroot().nsmap
+    return topXObj
 
 def parsef(f, rootXClass = None, nameSpaceMap = {}):
     schemaf = None

From johnsonm@rpath.com Mon Dec 15 20:05:08 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK58cg022731
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:05:08 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK573d019662
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:08 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK56Lm012456
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:06 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK56iE027365
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:06 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK56wn027363
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:05:06 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152005.mBFK56wn027363@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:05:06 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: make walking parsed elementtree's a method of root x objects
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:05:08 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

make walking parsed elementtree's a method of root x objects

diff -r 47b59f381603 -r d6c3944c4b19 test/xobjtest.py
--- a/test/xobjtest.py	Tue Dec 09 20:35:54 2008 -0500
+++ b/test/xobjtest.py	Tue Dec 09 23:14:04 2008 -0500
@@ -30,7 +30,10 @@
             subelement = SubelementClass
             unused = str
 
-        o = xobj.parsef(xml, rootXClass = TopClass)
+        class RootClass(xobj.RootXObject):
+            top = TopClass
+
+        o = xobj.parsef(xml, rootXClass = RootClass)
         self.assertEqual(o.top.subelement.subattr, 2)
         self.assertEqual(o.top.unused, None)
 
@@ -40,13 +43,13 @@
             subattr = [ int ]
         TopClass.subelement = SubelementClass
 
-        o = xobj.parsef(xml, rootXClass = TopClass)
+        o = xobj.parsef(xml, rootXClass = RootClass)
         self.assertEqual(o.top.subelement.subattr, [ 2 ] )
 
         # ---
 
         TopClass.subelement = [ SubelementClass ]
-        o = xobj.parsef(xml, rootXClass = TopClass)
+        o = xobj.parsef(xml, rootXClass = RootClass)
         self.assertEqual(o.top.subelement[0].subattr, [ 2] )
 
 
diff -r 47b59f381603 -r d6c3944c4b19 xobj/xobj.py
--- a/xobj/xobj.py	Tue Dec 09 20:35:54 2008 -0500
+++ b/xobj/xobj.py	Tue Dec 09 23:14:04 2008 -0500
@@ -7,6 +7,14 @@
     pass
 
 class XType(object):
+
+    def _isComplex(self):
+        complex = False
+        for key in self.pythonType.__dict__.iterkeys():
+            if key[0] != '_':
+                return True
+
+        return False
 
     def __init__(self, pythonType, forceList = False):
         self.pythonType = pythonType
@@ -33,15 +41,6 @@
 class XObject(object):
 
     _elementOrder = None
-
-    def _isComplex(self):
-        complex = False
-        for key in xType.pythonType.__dict__.iterkeys():
-            if key[0] != '_':
-                complex = True
-                break
-
-        return False
 
     def _setAttribute(self, key, val):
         expectedType = getattr(self.__class__, key, None)
@@ -94,8 +93,6 @@
         for key, val in self.__dict__.iteritems():
             if key[0] != '_':
                 if getattr(val, '_isattr', False):
-                    #if key.startswith('ovf_size'):
-                        #import epdb;epdb.st()
                     key = addns(key)
                     attrs[key] = str(val)
                 else:
@@ -148,6 +145,84 @@
                                  rewriteMap = nsmap)
         return etree.tostring(et, pretty_print = True, encoding = 'UTF-8')
 
+    def fromElementTree(self, xml, rootXClass = None, nameSpaceMap = {}):
+
+        def nsmap(s):
+            for key, val in nameSpaceMap.iteritems():
+                if s.startswith(key):
+                    s = s.replace(key, val + '_')
+
+            return s
+
+        def parseElement(element, parentXType = None, parentXObj = None):
+            # handle the text for this tag
+            if element.getchildren():
+                text = None
+            else:
+                text = element.text
+
+            tag = nsmap(element.tag)
+
+            if parentXObj is None:
+                parentXObj = self
+                parentXType = XTypeFromXObjectType(self.__class__)
+
+            thisXType = None
+            if parentXType:
+                thisPyType = getattr(parentXType.pythonType, tag, None)
+                if thisPyType:
+                    thisXType = XTypeFromXObjectType(thisPyType)
+
+            if element.getchildren():
+                # It's a complex type, so the text is meaningless.
+                text = None
+
+            if thisXType:
+                if text is not None and thisXType._isComplex():
+                    # This type has child elements, so it's complex, so
+                    # the text is meaningless.
+                    text = None
+
+                xobj = thisXType.pythonType(text)
+            else:
+                localTag = nsmap(element.tag)
+                # create a subclass for this type
+                if text is None:
+                    NewClass = type(localTag + '_XObj_Type', (XObject,), {})
+                else:
+                    NewClass = type(localTag + '_XObj_Type', (XObjectStr,), {})
+                xobj = NewClass(text)
+
+            # handle children
+            for childElement in element.getchildren():
+                if types.BuiltinFunctionType == type(childElement.tag):
+                    # this catches comments. this is ugly.
+                    continue
+                child = parseElement(childElement, parentXType = thisXType,
+                                     parentXObj = xobj)
+
+            # handle attributes
+            for (key, val) in element.items():
+                key = nsmap(key)
+                xobj._setAttribute(key, val)
+
+            # anything which is the same as in the class wasn't set in XML, so
+            # set it to None
+            for key, val in xobj.__class__.__dict__.items():
+                if key[0] == '_': continue
+                if getattr(xobj, key) == val:
+                    setattr(xobj, key, None)
+
+            if parentXObj is not None:
+                parentXObj._addElement(tag, xobj, thisXType)
+
+            return xobj
+
+        rootElement = xml.getroot()
+
+        parseElement(rootElement)
+        self._nsmap = xml.getroot().nsmap
+
 class XObjectInt(XObject, int):
 
     pass
@@ -160,87 +235,6 @@
 
     pass
 
-def parse(xml, rootXClass = None, nameSpaceMap = {}):
-
-    def nsmap(s):
-        for key, val in nameSpaceMap.iteritems():
-            if s.startswith(key):
-                s = s.replace(key, val + '_')
-
-        return s
-
-    def parseElement(element, parentXType = None, parentXObj = None):
-        # handle the text for this tag
-        if element.getchildren():
-            text = None
-        else:
-            text = element.text
-
-        tag = nsmap(element.tag)
-
-        thisXType = None
-        if isinstance(parentXObj, RootXObject):
-            # This handles the root element where the parentXType is
-            # really the XType for the root.
-            if parentXType:
-                thisPyType = parentXType.pythonType
-                thisXType = XTypeFromXObjectType(thisPyType)
-        elif parentXType:
-            thisPyType = getattr(parentXType.pythonType, tag, None)
-            if thisPyType:
-                thisXType = XTypeFromXObjectType(thisPyType)
-
-        if thisXType:
-            if text:
-                if thisXType.isComplex():
-                    text = None
-
-            xobj = thisXType.pythonType(text)
-        else:
-            localTag = nsmap(element.tag)
-            # create a subclass for this type
-            if text is None:
-                NewClass = type(localTag + '_XObj_Type', (XObject,), {})
-            else:
-                NewClass = type(localTag + '_XObj_Type', (XObjectStr,), {})
-            xobj = NewClass(text)
-
-        # handle children
-        for childElement in element.getchildren():
-            if types.BuiltinFunctionType == type(childElement.tag):
-                # this catches comments. this is ugly.
-                continue
-            child = parseElement(childElement, parentXType = thisXType,
-                                 parentXObj = xobj)
-
-        # handle attributes
-        for (key, val) in element.items():
-            key = nsmap(key)
-            xobj._setAttribute(key, val)
-
-        # anything which is the same as in the class wasn't set in XML, so
-        # set it to None
-        for key, val in xobj.__class__.__dict__.items():
-            if key[0] == '_': continue
-            if getattr(xobj, key) == val:
-                setattr(xobj, key, None)
-
-        if parentXObj is not None:
-            parentXObj._addElement(tag, xobj, thisXType)
-
-        return xobj
-
-    if rootXClass:
-        rootXType = XTypeFromXObjectType(rootXClass)
-    else:
-        rootXType = None
-
-    topXObj = RootXObject()
-    parseElement(xml.getroot(), parentXType = rootXType,
-                 parentXObj = topXObj)
-    topXObj._nsmap = xml.getroot().nsmap
-    return topXObj
-
 def parsef(f, rootXClass = None, nameSpaceMap = {}):
     schemaf = None
     if schemaf:
@@ -252,7 +246,13 @@
     else:
         schema = schemaXml = schemaXObj = schemaObj = None
 
+    if rootXClass is None:
+        rootXClass = RootXObject
+
+    rootObj = rootXClass()
+
     parser = etree.XMLParser(schema = schemaObj)
     xml = etree.parse(f, parser)
+    rootObj.fromElementTree(xml, nameSpaceMap = nameSpaceMap)
 
-    return parse(xml, rootXClass = rootXClass, nameSpaceMap = nameSpaceMap)
+    return rootObj

From johnsonm@rpath.com Mon Dec 15 20:05:17 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK5Htp022737
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:05:17 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK5HhR019669
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:17 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK5HqE012467
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:17 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK5HO8027394
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:17 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK5HwY027392
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:05:17 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152005.mBFK5HwY027392@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:05:17 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: clenaed up namespace handling to merge user ns map with
	nsmap from the xml
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:05:18 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

clenaed up namespace handling to merge user ns map with nsmap from the xml
and to use that for both parsing and generating xml

diff -r d6c3944c4b19 -r 300b2976f482 test/xobjtest.py
--- a/test/xobjtest.py	Tue Dec 09 23:14:04 2008 -0500
+++ b/test/xobjtest.py	Wed Dec 10 17:33:19 2008 -0500
@@ -14,7 +14,7 @@
                        '    <!-- comment -->'
                        '    <prop>something</prop>\n'
                        '    <subelement subattr="2"/>\n'
-                       '    </top>\n')
+                       '</top>\n')
         o = xobj.parsef(xml)
         self.assertEqual(o.top.__class__.__name__, 'top_XObj_Type')
         self.assertEqual(o.top.attr, 'anattr')
@@ -52,6 +52,28 @@
         o = xobj.parsef(xml, rootXClass = RootClass)
         self.assertEqual(o.top.subelement[0].subattr, [ 2] )
 
+    def testNamespaces(self):
+        xmlString = ('<top xmlns="http://this" xmlns:other="http://other/other"'
+                        ' xmlns:other2="http://other/other2">\n'
+                     '  <local/>\n'
+                     '  <other:tag val="1"/>\n'
+                     '  <other2:tag val="2"/>\n'
+                     '</top>\n')
+        xml = StringIO(xmlString)
+        o = xobj.parsef(xml)
+        assert(o.top.other_tag.val == '1')
+        assert(o.top.other2_tag.val == '2')
+        assert(o.tostring() == xmlString)
+
+        class Top(xobj.RootXObject):
+            nameSpaceMap = { 'other3' : 'http://other/other2' }
+
+        o = xobj.parsef(xml, rootXClass = Top)
+        assert(o.top.other_tag.val == '1')
+        assert(o.top.other3_tag.val == '2')
+        newXmlString = xmlString.replace("other2:", "other3:")
+        newXmlString = newXmlString.replace(":other2", ":other3")
+        assert(o.tostring() == newXmlString)
 
 if __name__ == "__main__":
     testsuite.main()
diff -r d6c3944c4b19 -r 300b2976f482 xobj/xobj.py
--- a/xobj/xobj.py	Tue Dec 09 23:14:04 2008 -0500
+++ b/xobj/xobj.py	Wed Dec 10 17:33:19 2008 -0500
@@ -79,12 +79,12 @@
         else:
             setattr(self, key, [ current, val ])
 
-    def getElementTree(self, tag, rootElement = None, nsmap = {},
-                       rewriteMap = {}):
+    def getElementTree(self, tag, rootElement = None, nsmap = {}):
+
         def addns(s):
-            for key, val in rewriteMap.iteritems():
-                if s.startswith(key + '_'):
-                    s = s.replace(key + '_', val)
+            for short, long in nsmap.iteritems():
+                if short and s.startswith(short + '_'):
+                    s = '{' + long + '}' + s[len(short) + 1:]
 
             return s
 
@@ -121,11 +121,9 @@
                 key = addns(key)
                 if type(val) == list:
                     for subval in val:
-                        subval.getElementTree(key, rootElement = element,
-                                              rewriteMap = rewriteMap)
+                        subval.getElementTree(key, rootElement = element)
                 else:
-                    val.getElementTree(key, rootElement = element,
-                                       rewriteMap = rewriteMap)
+                    val.getElementTree(key, rootElement = element)
 
         return element
 
@@ -134,23 +132,26 @@
 
 class RootXObject(XObject):
 
-    def tostring(self, nsmap = {}):
-        foo = dict(self._nsmap)
-        foo['ovf'] = 'http://schemas.dmtf.org/ovf/envelope/1'
+    nameSpaceMap = {}
+
+    def tostring(self, nsmap = {}, prettyPrint = True):
         for key, val in self.__dict__.iteritems():
             if isinstance(val, XObject):
                 break
 
-        et = val.getElementTree(key, nsmap = foo,
-                                 rewriteMap = nsmap)
-        return etree.tostring(et, pretty_print = True, encoding = 'UTF-8')
+        et = val.getElementTree(key, nsmap = self._xmlNsMap)
+        return etree.tostring(et, pretty_print = prettyPrint,
+                              encoding = 'UTF-8')
 
     def fromElementTree(self, xml, rootXClass = None, nameSpaceMap = {}):
 
         def nsmap(s):
-            for key, val in nameSpaceMap.iteritems():
-                if s.startswith(key):
-                    s = s.replace(key, val + '_')
+            for short, long in self._xmlNsMap.iteritems():
+                if s.startswith('{' + long + '}'):
+                    if short:
+                        s = short + '_' + s[len(long) + 2:]
+                    else:
+                        s = s[len(long) + 2:]
 
             return s
 
@@ -220,8 +221,17 @@
 
         rootElement = xml.getroot()
 
+        if not self.nameSpaceMap:
+            self._xmlNsMap = rootElement.nsmap
+        else:
+            fullNsMap = dict((y,x) for (x,y) in self.nameSpaceMap.iteritems())
+            for short, long in rootElement.nsmap.iteritems():
+                if long not in fullNsMap:
+                    fullNsMap[long] = short
+
+            self._xmlNsMap = dict((y,x) for (x,y) in fullNsMap.iteritems())
+
         parseElement(rootElement)
-        self._nsmap = xml.getroot().nsmap
 
 class XObjectInt(XObject, int):
 
@@ -235,7 +245,7 @@
 
     pass
 
-def parsef(f, rootXClass = None, nameSpaceMap = {}):
+def parsef(f, rootXClass = None):
     schemaf = None
     if schemaf:
         schemaXml = etree.parse(schemaf)
@@ -253,6 +263,6 @@
 
     parser = etree.XMLParser(schema = schemaObj)
     xml = etree.parse(f, parser)
-    rootObj.fromElementTree(xml, nameSpaceMap = nameSpaceMap)
+    rootObj.fromElementTree(xml)
 
     return rootObj

From johnsonm@rpath.com Mon Dec 15 20:05:28 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK5SKD022749
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:05:28 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK5SEp019686
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:28 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK5S2Z012477
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:28 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK5RvW027423
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:27 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK5RZs027421
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:05:27 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152005.mBFK5RZs027421@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:05:27 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: test namespace mapping for attributed
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:05:28 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

test namespace mapping for attributed

diff -r 300b2976f482 -r 27e47ce33980 test/xobjtest.py
--- a/test/xobjtest.py	Wed Dec 10 17:33:19 2008 -0500
+++ b/test/xobjtest.py	Wed Dec 10 17:41:35 2008 -0500
@@ -56,12 +56,12 @@
         xmlString = ('<top xmlns="http://this" xmlns:other="http://other/other"'
                         ' xmlns:other2="http://other/other2">\n'
                      '  <local/>\n'
-                     '  <other:tag val="1"/>\n'
+                     '  <other:tag other:val="1"/>\n'
                      '  <other2:tag val="2"/>\n'
                      '</top>\n')
         xml = StringIO(xmlString)
         o = xobj.parsef(xml)
-        assert(o.top.other_tag.val == '1')
+        assert(o.top.other_tag.other_val == '1')
         assert(o.top.other2_tag.val == '2')
         assert(o.tostring() == xmlString)
 
@@ -69,7 +69,7 @@
             nameSpaceMap = { 'other3' : 'http://other/other2' }
 
         o = xobj.parsef(xml, rootXClass = Top)
-        assert(o.top.other_tag.val == '1')
+        assert(o.top.other_tag.other_val == '1')
         assert(o.top.other3_tag.val == '2')
         newXmlString = xmlString.replace("other2:", "other3:")
         newXmlString = newXmlString.replace(":other2", ":other3")
diff -r 300b2976f482 -r 27e47ce33980 xobj/xobj.py
--- a/xobj/xobj.py	Wed Dec 10 17:33:19 2008 -0500
+++ b/xobj/xobj.py	Wed Dec 10 17:41:35 2008 -0500
@@ -121,9 +121,11 @@
                 key = addns(key)
                 if type(val) == list:
                     for subval in val:
-                        subval.getElementTree(key, rootElement = element)
+                        subval.getElementTree(key, rootElement = element,
+                                              nsmap = nsmap)
                 else:
-                    val.getElementTree(key, rootElement = element)
+                    val.getElementTree(key, rootElement = element,
+                                       nsmap = nsmap)
 
         return element
 

From johnsonm@rpath.com Mon Dec 15 20:05:39 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK5dhr022755
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:05:39 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK5d3w019706
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:39 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK5cs5012485
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:39 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK5c2J027453
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:38 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK5cgR027451
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:05:38 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152005.mBFK5cgR027451@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:05:38 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: added schema validation on parse
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:05:39 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

added schema validation on parse

diff -r 27e47ce33980 -r 8fa30142a30f test/xobjtest.py
--- a/test/xobjtest.py	Wed Dec 10 17:41:35 2008 -0500
+++ b/test/xobjtest.py	Wed Dec 10 18:05:05 2008 -0500
@@ -3,6 +3,7 @@
 import testsuite
 testsuite.setup()
 from testrunner import testhelp
+from lxml import etree
 
 from xobj import xobj
 from StringIO import StringIO
@@ -75,5 +76,39 @@
         newXmlString = newXmlString.replace(":other2", ":other3")
         assert(o.tostring() == newXmlString)
 
+    def testSchemaValidation(self):
+        s = (
+            '<?xml version="1.0" encoding="UTF-8"?>\n'
+            '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">\n'
+            '   <xs:element name="top">\n'
+            '    <xs:complexType>\n'
+            '      <xs:sequence>\n'
+            '        <xs:element name="prop" type="xs:string"/>\n'
+            '        <xs:element name="subelement">\n'
+            '          <xs:complexType>\n'
+            '          <xs:attribute name="subattr" type="xs:integer"/>\n'
+            '          </xs:complexType>\n'
+            '        </xs:element>\n'
+            '      </xs:sequence>\n'
+            '      <xs:attribute name="attr" type="xs:string"/>\n'
+            '    </xs:complexType>\n'
+            '  </xs:element>\n'
+            '</xs:schema>\n')
+        schema = StringIO(s)
+
+        s = (
+            '<top attr="anattr">\n'
+            '  <prop>something</prop>\n'
+            '  <subelement subattr="2"/>\n'
+            '</top>\n')
+        xml = StringIO(s)
+        xobj.parsef(xml, schemaf = schema)
+
+        xml = StringIO(s.replace('prop', 'prop2'))
+        xobj.parsef(xml)
+        self.assertRaises(etree.XMLSyntaxError,
+                          xobj.parsef, xml, schemaf = schema)
+
+
 if __name__ == "__main__":
     testsuite.main()
diff -r 27e47ce33980 -r 8fa30142a30f xobj/xobj.py
--- a/xobj/xobj.py	Wed Dec 10 17:41:35 2008 -0500
+++ b/xobj/xobj.py	Wed Dec 10 18:05:05 2008 -0500
@@ -1,6 +1,7 @@
 from lxml import etree
 import xmlschema
 import types
+from StringIO import StringIO
 
 class UnknownXType(Exception):
 
@@ -88,6 +89,8 @@
 
             return s
 
+        tag = addns(tag)
+
         attrs = {}
         elements = {}
         for key, val in self.__dict__.iteritems():
@@ -118,7 +121,6 @@
 
         for key, val in orderedElements:
             if val is not None:
-                key = addns(key)
                 if type(val) == list:
                     for subval in val:
                         subval.getElementTree(key, rootElement = element,
@@ -142,13 +144,16 @@
                 break
 
         et = val.getElementTree(key, nsmap = self._xmlNsMap)
-        return etree.tostring(et, pretty_print = prettyPrint,
-                              encoding = 'UTF-8')
+        xmlString = etree.tostring(et, pretty_print = prettyPrint,
+                                   encoding = 'UTF-8')
+
+        return xmlString
 
     def fromElementTree(self, xml, rootXClass = None, nameSpaceMap = {}):
 
         def nsmap(s):
             for short, long in self._xmlNsMap.iteritems():
+                if not short: continue
                 if s.startswith('{' + long + '}'):
                     if short:
                         s = short + '_' + s[len(long) + 2:]
@@ -247,16 +252,11 @@
 
     pass
 
-def parsef(f, rootXClass = None):
-    schemaf = None
+def parsef(f, schemaf = None, rootXClass = None):
     if schemaf:
-        schemaXml = etree.parse(schemaf)
-        schemaXObj = parse(schemaXml, nameSpaceMap = 
-                           { '{http://www.w3.org/2001/XMLSchema}' : 'xsd_' })
-        schema = xmlschema.Schema(schemaXObj)
-        schemaObj = etree.XMLSchema(schemaXml)
+        schemaObj = etree.XMLSchema(etree.parse(schemaf))
     else:
-        schema = schemaXml = schemaXObj = schemaObj = None
+        schemaObj = None
 
     if rootXClass is None:
         rootXClass = RootXObject

From johnsonm@rpath.com Mon Dec 15 20:05:50 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK5o0s022761
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:05:50 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK5nu8019714
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:49 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK5nc4012494
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:49 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK5nUt027482
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:49 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK5nX5027480
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:05:49 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152005.mBFK5nX5027480@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:05:49 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: 1. added autodetection of duplicate namespaces and fully
	qualify those (hack)
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:05:50 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

1. added autodetection of duplicate namespaces and fully qualify those (hack)
2. added xml_declaration to tostring()

diff -r 8fa30142a30f -r 1d8b0f3e1ae8 test/xobjtest.py
--- a/test/xobjtest.py	Wed Dec 10 18:05:05 2008 -0500
+++ b/test/xobjtest.py	Thu Dec 11 10:51:06 2008 -0500
@@ -21,6 +21,8 @@
         self.assertEqual(o.top.attr, 'anattr')
         self.assertEqual(o.top.prop, 'something')
         self.assertEqual(o.top.subelement.subattr, '2')
+        self.assertEqual(o.top.subelement.__class__.__name__,
+                         'subelement_XObj_Type')
 
         # ---
 
@@ -64,7 +66,7 @@
         o = xobj.parsef(xml)
         assert(o.top.other_tag.other_val == '1')
         assert(o.top.other2_tag.val == '2')
-        assert(o.tostring() == xmlString)
+        assert(o.tostring(xml_declaration = False) == xmlString)
 
         class Top(xobj.RootXObject):
             nameSpaceMap = { 'other3' : 'http://other/other2' }
@@ -74,7 +76,7 @@
         assert(o.top.other3_tag.val == '2')
         newXmlString = xmlString.replace("other2:", "other3:")
         newXmlString = newXmlString.replace(":other2", ":other3")
-        assert(o.tostring() == newXmlString)
+        assert(o.tostring(xml_declaration = False) == newXmlString)
 
     def testSchemaValidation(self):
         s = (
diff -r 8fa30142a30f -r 1d8b0f3e1ae8 xobj/xobj.py
--- a/xobj/xobj.py	Wed Dec 10 18:05:05 2008 -0500
+++ b/xobj/xobj.py	Thu Dec 11 10:51:06 2008 -0500
@@ -138,14 +138,21 @@
 
     nameSpaceMap = {}
 
-    def tostring(self, nsmap = {}, prettyPrint = True):
+    def tostring(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
         for key, val in self.__dict__.iteritems():
             if isinstance(val, XObject):
                 break
 
-        et = val.getElementTree(key, nsmap = self._xmlNsMap)
+        if self._explicitNamespaces:
+            map = self._xmlNsMap.copy()
+            del map[None]
+        else:
+            map = self._xmlNsMap
+
+        et = val.getElementTree(key, nsmap = map)
         xmlString = etree.tostring(et, pretty_print = prettyPrint,
-                                   encoding = 'UTF-8')
+                                   encoding = 'UTF-8',
+                                   xml_declaration = xml_declaration)
 
         return xmlString
 
@@ -153,7 +160,9 @@
 
         def nsmap(s):
             for short, long in self._xmlNsMap.iteritems():
-                if not short: continue
+                if self._explicitNamespaces and short is None:
+                    continue
+
                 if s.startswith('{' + long + '}'):
                     if short:
                         s = short + '_' + s[len(long) + 2:]
@@ -238,6 +247,12 @@
 
             self._xmlNsMap = dict((y,x) for (x,y) in fullNsMap.iteritems())
 
+        self._explicitNamespaces = False
+        if None in self._xmlNsMap:
+            if [ y for (x, y) in self._xmlNsMap.iteritems()
+                    if x and y == self._xmlNsMap[None] ]:
+                self._explicitNamespaces = True
+
         parseElement(rootElement)
 
 class XObjectInt(XObject, int):

From johnsonm@rpath.com Mon Dec 15 20:06:00 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK60KH022767
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:06:00 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK60fO019728
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:00 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK60Jo012534
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:00 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK5xfM027511
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:05:59 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK5xmE027509
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:05:59 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152005.mBFK5xmE027509@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:05:59 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: got rid of _isattr and used _attributes instead
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:06:00 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

got rid of _isattr and used _attributes instead
replaced _elementOrder with __elements

diff -r 1d8b0f3e1ae8 -r 2631eaf196b9 test/xobjtest.py
--- a/test/xobjtest.py	Thu Dec 11 10:51:06 2008 -0500
+++ b/test/xobjtest.py	Thu Dec 11 11:31:12 2008 -0500
@@ -11,14 +11,15 @@
 class XobjTest(testhelp.TestCase):
 
     def testSimpleParse(self):
-        xml = StringIO('<top attr="anattr">\n'
+        xml = StringIO('<top attr1="anattr" attr2="another">\n'
                        '    <!-- comment -->'
                        '    <prop>something</prop>\n'
                        '    <subelement subattr="2"/>\n'
                        '</top>\n')
         o = xobj.parsef(xml)
         self.assertEqual(o.top.__class__.__name__, 'top_XObj_Type')
-        self.assertEqual(o.top.attr, 'anattr')
+        self.assertEqual(o.top.attr1, 'anattr')
+        self.assertEqual(o.top.attr2, 'another')
         self.assertEqual(o.top.prop, 'something')
         self.assertEqual(o.top.subelement.subattr, '2')
         self.assertEqual(o.top.subelement.__class__.__name__,
diff -r 1d8b0f3e1ae8 -r 2631eaf196b9 xobj/xobj.py
--- a/xobj/xobj.py	Thu Dec 11 10:51:06 2008 -0500
+++ b/xobj/xobj.py	Thu Dec 11 11:31:12 2008 -0500
@@ -41,7 +41,8 @@
 
 class XObject(object):
 
-    _elementOrder = None
+    _elements = []
+    _attributes = set()
 
     def _setAttribute(self, key, val):
         expectedType = getattr(self.__class__, key, None)
@@ -52,16 +53,19 @@
             expectedXType = None
             val = XObjectStr(val)
 
-        val._isattr = True
+        if not self._attributes:
+            self._attributes = set([key])
+        elif key not in self._attributes:
+            self._attributes.add(key)
 
         self._setItem(key, val, expectedXType)
 
     def _addElement(self, key, val, xType = None):
         self._setItem(key, val, xType = xType)
-        if self._elementOrder is None:
-            self._elementOrder = [ key ]
-        elif key not in self._elementOrder:
-            self._elementOrder.append(key)
+        if not self._elements:
+            self._elements = [ key ]
+        elif key not in self._elements:
+            self._elements.append(key)
 
     def _setItem(self, key, val, xType = None):
         current = getattr(self, key, None)
@@ -95,7 +99,7 @@
         elements = {}
         for key, val in self.__dict__.iteritems():
             if key[0] != '_':
-                if getattr(val, '_isattr', False):
+                if key in self._attributes:
                     key = addns(key)
                     attrs[key] = str(val)
                 else:
@@ -103,11 +107,11 @@
                     l.append(val)
 
         orderedElements = []
-        if self._elementOrder:
-            for name in self._elementOrder:
+        if self._elements:
+            for name in self._elements:
                 for val in elements[name]:
                     orderedElements.append((name, val))
-            for name in (set(elements) - set(self._elementOrder)):
+            for name in (set(elements) - set(self._elements)):
                 for val in elements[name]:
                     orderedElements.append((name, val))
 

From johnsonm@rpath.com Mon Dec 15 20:06:11 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK6Bxm022773
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:06:11 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK6AFh019737
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:11 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK6AaI012550
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:10 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK6Ab1027540
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:10 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK6AHB027538
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:06:10 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152006.mBFK6AHB027538@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:06:10 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: exclude test/ from coverage
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:06:11 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/testsuite.py

exclude test/ from coverage

diff -r 2631eaf196b9 -r ad7d7d903b3f test/testsuite.py
--- a/test/testsuite.py	Thu Dec 11 11:31:12 2008 -0500
+++ b/test/testsuite.py	Thu Dec 11 13:42:55 2008 -0500
@@ -49,7 +49,8 @@
     setup()
 
     cfg.cleanTestDirs = not individual
-    cfg.coverageExclusions = ['scripts/.*', 'epdb.py', 'stackutil.py']
+    cfg.coverageExclusions = ['scripts/.*', 'epdb.py', 'stackutil.py',
+                              'test/.*']
     cfg.coverageDirs = [ os.environ['XOBJ_PATH'] ]
 
     if argv is None:

From johnsonm@rpath.com Mon Dec 15 20:06:21 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK6Ldr022779
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:06:21 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK6LC2019746
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:21 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK6Lhv012557
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:21 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK6LGA027569
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:21 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK6L17027567
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:06:21 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152006.mBFK6L17027567@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:06:20 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: renamed root object to Document
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:06:22 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

renamed root object to Document

diff -r ad7d7d903b3f -r 0732b1cb67c5 test/xobjtest.py
--- a/test/xobjtest.py	Thu Dec 11 13:42:55 2008 -0500
+++ b/test/xobjtest.py	Thu Dec 11 13:57:11 2008 -0500
@@ -34,10 +34,10 @@
             subelement = SubelementClass
             unused = str
 
-        class RootClass(xobj.RootXObject):
+        class DocumentClass(xobj.Document):
             top = TopClass
 
-        o = xobj.parsef(xml, rootXClass = RootClass)
+        o = xobj.parsef(xml, documentClass = DocumentClass)
         self.assertEqual(o.top.subelement.subattr, 2)
         self.assertEqual(o.top.unused, None)
 
@@ -47,13 +47,13 @@
             subattr = [ int ]
         TopClass.subelement = SubelementClass
 
-        o = xobj.parsef(xml, rootXClass = RootClass)
+        o = xobj.parsef(xml, documentClass = DocumentClass)
         self.assertEqual(o.top.subelement.subattr, [ 2 ] )
 
         # ---
 
         TopClass.subelement = [ SubelementClass ]
-        o = xobj.parsef(xml, rootXClass = RootClass)
+        o = xobj.parsef(xml, documentClass = DocumentClass)
         self.assertEqual(o.top.subelement[0].subattr, [ 2] )
 
     def testNamespaces(self):
@@ -69,10 +69,10 @@
         assert(o.top.other2_tag.val == '2')
         assert(o.tostring(xml_declaration = False) == xmlString)
 
-        class Top(xobj.RootXObject):
+        class Top(xobj.Document):
             nameSpaceMap = { 'other3' : 'http://other/other2' }
 
-        o = xobj.parsef(xml, rootXClass = Top)
+        o = xobj.parsef(xml, documentClass = Top)
         assert(o.top.other_tag.other_val == '1')
         assert(o.top.other3_tag.val == '2')
         newXmlString = xmlString.replace("other2:", "other3:")
diff -r ad7d7d903b3f -r 0732b1cb67c5 xobj/xobj.py
--- a/xobj/xobj.py	Thu Dec 11 13:42:55 2008 -0500
+++ b/xobj/xobj.py	Thu Dec 11 13:57:11 2008 -0500
@@ -138,7 +138,7 @@
     def __init__(self, text = None):
         self.text = text
 
-class RootXObject(XObject):
+class Document(XObject):
 
     nameSpaceMap = {}
 
@@ -271,19 +271,19 @@
 
     pass
 
-def parsef(f, schemaf = None, rootXClass = None):
+def parsef(f, schemaf = None, documentClass = None):
     if schemaf:
         schemaObj = etree.XMLSchema(etree.parse(schemaf))
     else:
         schemaObj = None
 
-    if rootXClass is None:
-        rootXClass = RootXObject
+    if documentClass is None:
+        documentClass = Document
 
-    rootObj = rootXClass()
+    document = documentClass()
 
     parser = etree.XMLParser(schema = schemaObj)
     xml = etree.parse(f, parser)
-    rootObj.fromElementTree(xml)
+    document.fromElementTree(xml)
 
-    return rootObj
+    return document

From johnsonm@rpath.com Mon Dec 15 20:06:32 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK6Wtb022785
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:06:32 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK6Wd8019763
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:32 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK6WjN012567
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:32 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK6VWM027602
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:31 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK6VWH027600
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:06:31 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152006.mBFK6VWH027600@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:06:31 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: renamed _xmlNsMap to __xmlNsMap and _explicitNamespaces
	to __explictNamespaces
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:06:32 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       xobj/xobj.py

renamed _xmlNsMap to __xmlNsMap and _explicitNamespaces to __explictNamespaces

diff -r 0732b1cb67c5 -r 8a9916f75f5e xobj/xobj.py
--- a/xobj/xobj.py	Thu Dec 11 13:57:11 2008 -0500
+++ b/xobj/xobj.py	Thu Dec 11 14:01:56 2008 -0500
@@ -147,11 +147,11 @@
             if isinstance(val, XObject):
                 break
 
-        if self._explicitNamespaces:
-            map = self._xmlNsMap.copy()
+        if self.__explicitNamespaces:
+            map = self.__xmlNsMap.copy()
             del map[None]
         else:
-            map = self._xmlNsMap
+            map = self.__xmlNsMap
 
         et = val.getElementTree(key, nsmap = map)
         xmlString = etree.tostring(et, pretty_print = prettyPrint,
@@ -163,8 +163,8 @@
     def fromElementTree(self, xml, rootXClass = None, nameSpaceMap = {}):
 
         def nsmap(s):
-            for short, long in self._xmlNsMap.iteritems():
-                if self._explicitNamespaces and short is None:
+            for short, long in self.__xmlNsMap.iteritems():
+                if self.__explicitNamespaces and short is None:
                     continue
 
                 if s.startswith('{' + long + '}'):
@@ -242,20 +242,20 @@
         rootElement = xml.getroot()
 
         if not self.nameSpaceMap:
-            self._xmlNsMap = rootElement.nsmap
+            self.__xmlNsMap = rootElement.nsmap
         else:
             fullNsMap = dict((y,x) for (x,y) in self.nameSpaceMap.iteritems())
             for short, long in rootElement.nsmap.iteritems():
                 if long not in fullNsMap:
                     fullNsMap[long] = short
 
-            self._xmlNsMap = dict((y,x) for (x,y) in fullNsMap.iteritems())
+            self.__xmlNsMap = dict((y,x) for (x,y) in fullNsMap.iteritems())
 
-        self._explicitNamespaces = False
-        if None in self._xmlNsMap:
-            if [ y for (x, y) in self._xmlNsMap.iteritems()
-                    if x and y == self._xmlNsMap[None] ]:
-                self._explicitNamespaces = True
+        self.__explicitNamespaces = False
+        if None in self.__xmlNsMap:
+            if [ y for (x, y) in self.__xmlNsMap.iteritems()
+                    if x and y == self.__xmlNsMap[None] ]:
+                self.__explicitNamespaces = True
 
         parseElement(rootElement)
 

From johnsonm@rpath.com Mon Dec 15 20:06:43 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK6hva022791
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:06:43 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK6hwW019789
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:43 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK6gHO012575
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:42 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK6ggK027632
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:42 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK6gYq027630
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:06:42 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152006.mBFK6gYq027630@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:06:42 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: added license info everywhere
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:06:43 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       LICENSE test/bootstrap.py test/testsuite.py test/xobjtest.py xobj/__init__.py xobj/xmlschema.py xobj/xobj.py

added license info everywhere

diff -r 8a9916f75f5e -r 775462a7d260 LICENSE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSE	Fri Dec 12 09:29:46 2008 -0500
@@ -0,0 +1,19 @@
+Copyright (c) 2005 rPath, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff -r 8a9916f75f5e -r 775462a7d260 test/bootstrap.py
--- a/test/bootstrap.py	Thu Dec 11 14:01:56 2008 -0500
+++ b/test/bootstrap.py	Fri Dec 12 09:29:46 2008 -0500
@@ -1,3 +1,14 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+
 import os
 import sys
 
diff -r 8a9916f75f5e -r 775462a7d260 test/testsuite.py
--- a/test/testsuite.py	Thu Dec 11 14:01:56 2008 -0500
+++ b/test/testsuite.py	Fri Dec 12 09:29:46 2008 -0500
@@ -1,7 +1,14 @@
 #!/usr/bin/python
-# -*- mode: python -*-
 #
-# Copyright (c) 2004-2008 rPath, Inc.
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
 #
 import os
 import sys
diff -r 8a9916f75f5e -r 775462a7d260 test/xobjtest.py
--- a/test/xobjtest.py	Thu Dec 11 14:01:56 2008 -0500
+++ b/test/xobjtest.py	Fri Dec 12 09:29:46 2008 -0500
@@ -1,4 +1,15 @@
 #!/usr/bin/python
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
 
 import testsuite
 testsuite.setup()
diff -r 8a9916f75f5e -r 775462a7d260 xobj/__init__.py
--- a/xobj/__init__.py	Thu Dec 11 14:01:56 2008 -0500
+++ b/xobj/__init__.py	Fri Dec 12 09:29:46 2008 -0500
@@ -0,0 +1,10 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
diff -r 8a9916f75f5e -r 775462a7d260 xobj/xmlschema.py
--- a/xobj/xmlschema.py	Thu Dec 11 14:01:56 2008 -0500
+++ b/xobj/xmlschema.py	Fri Dec 12 09:29:46 2008 -0500
@@ -1,3 +1,14 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+
 def smiter(item):
     if hasattr(item, '__iter__'):
         return item
diff -r 8a9916f75f5e -r 775462a7d260 xobj/xobj.py
--- a/xobj/xobj.py	Thu Dec 11 14:01:56 2008 -0500
+++ b/xobj/xobj.py	Fri Dec 12 09:29:46 2008 -0500
@@ -1,3 +1,14 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+
 from lxml import etree
 import xmlschema
 import types

From johnsonm@rpath.com Mon Dec 15 20:06:53 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK6rlT022797
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:06:53 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK6rPd019801
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:53 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK6r6t012591
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:53 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK6rGH027665
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:06:53 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK6qf9027663
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:06:52 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152006.mBFK6qf9027663@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:06:52 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: add another test for additional coverage, remove some
	duplicate code
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:06:53 -0000

user:        Michael K. Johnson <http://issues.rpath.com/>
files:       test/xobjtest.py xobj/xobj.py

add another test for additional coverage, remove some duplicate code

diff -r 775462a7d260 -r 182596c34039 test/xobjtest.py
--- a/test/xobjtest.py	Fri Dec 12 09:29:46 2008 -0500
+++ b/test/xobjtest.py	Fri Dec 12 15:43:35 2008 -0500
@@ -10,6 +10,8 @@
 # without any waranty; without even the implied warranty of merchantability
 # or fitness for a particular purpose. See the MIT License for full details.
 #
+
+import types
 
 import testsuite
 testsuite.setup()
@@ -67,6 +69,68 @@
         o = xobj.parsef(xml, documentClass = DocumentClass)
         self.assertEqual(o.top.subelement[0].subattr, [ 2] )
 
+    def testComplexParse(self):
+        xmlText = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                   '<top>\n'
+                   '  <prop>\n'
+                   '    <subprop subattr="1">asdf</subprop>\n'
+                   '    <subprop subattr="2">fdsa</subprop>\n'
+                   '  </prop>\n'
+                   '  <simple>simple</simple>\n'
+                   '</top>\n')
+        xml = StringIO(xmlText)
+        o = xobj.parsef(xml)
+
+        # ---
+
+        self.assertEqual(o.tostring(), xmlText)
+
+        # ---
+
+        self.assertEqual(o.top.__class__.__name__, 'top_XObj_Type')
+        self.assertEqual(type(o.top.prop.subprop), types.ListType)
+        self.assertEqual(o.top.prop.subprop, ['asdf', 'fdsa'])
+        asdf = o.top.prop.subprop[0]
+        self.assertEqual(asdf.__class__.__name__, 'subprop_XObj_Type')
+        self.assertEqual(o.top.prop.__class__.__name__,
+                         'prop_XObj_Type')
+        for i in range(2):
+            self.assertEqual(o.top.prop.subprop[i].__class__.__name__,
+                             'subprop_XObj_Type')
+
+        # ---
+
+        class SubpropClass(xobj.XObject):
+            subattr = int
+            unused = [ str ]
+
+        class PropClass(xobj.XObject):
+            subprop = [ SubpropClass ]
+
+        class SimpleClass(xobj.XObject):
+            pass
+
+        class TopClass(xobj.XObject):
+            unused = str
+            prop = PropClass
+            simple = [ SimpleClass ]
+
+        class DocumentClass(xobj.Document):
+            top = TopClass
+
+        o = xobj.parsef(xml, documentClass = DocumentClass)
+        self.assertEqual(o.top.prop.subprop[1].subattr, 2)
+        self.assertEqual(o.top.unused, None)
+        self.assertEqual(o.top.prop.subprop[0].unused, None)
+        self.assertEqual(o.top.simple[0].text, 'simple')
+
+        # ---
+
+        # asdf/fdsa have been dropped becuase text is dropped from
+        # the complex class PropClass
+        self.assertNotEqual(o.tostring(), xmlText)
+
+
     def testNamespaces(self):
         xmlString = ('<top xmlns="http://this" xmlns:other="http://other/other"'
                         ' xmlns:other2="http://other/other2">\n'
diff -r 775462a7d260 -r 182596c34039 xobj/xobj.py
--- a/xobj/xobj.py	Fri Dec 12 09:29:46 2008 -0500
+++ b/xobj/xobj.py	Fri Dec 12 15:43:35 2008 -0500
@@ -21,7 +21,6 @@
 class XType(object):
 
     def _isComplex(self):
-        complex = False
         for key in self.pythonType.__dict__.iterkeys():
             if key[0] != '_':
                 return True
@@ -37,8 +36,6 @@
     if (type(xObjectType) == type and
             issubclass(xObjectType, XObject)):
         return XType(xObjectType)
-    elif issubclass(xObjectType.__class__, XType):
-        return XType
     elif xObjectType == int:
         return XType(XObjectInt)
     elif xObjectType == str:
@@ -189,6 +186,7 @@
         def parseElement(element, parentXType = None, parentXObj = None):
             # handle the text for this tag
             if element.getchildren():
+                # It's a complex type, so the text is meaningless.
                 text = None
             else:
                 text = element.text
@@ -204,10 +202,6 @@
                 thisPyType = getattr(parentXType.pythonType, tag, None)
                 if thisPyType:
                     thisXType = XTypeFromXObjectType(thisPyType)
-
-            if element.getchildren():
-                # It's a complex type, so the text is meaningless.
-                text = None
 
             if thisXType:
                 if text is not None and thisXType._isComplex():

From johnsonm@rpath.com Mon Dec 15 20:07:04 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBFK74Ug022803
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 20:07:04 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK74Cn019810
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:07:04 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBFK738k012606
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:07:04 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBFK73YR027694
	for <xobj-commits@lists.rpath.com>; Mon, 15 Dec 2008 15:07:03 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBFK73I9027692
	for xobj-commits@lists.rpath.com; Mon, 15 Dec 2008 15:07:03 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812152007.mBFK73I9027692@scc.eng.rpath.com>
Date: Mon, 15 Dec 2008 15:07:03 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: more specific test in the complex case
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 15 Dec 2008 20:07:05 -0000

tag:         tip
user:        Michael K. Johnson <http://issues.rpath.com/>
files:       test/xobjtest.py

more specific test in the complex case

diff -r 182596c34039 -r a4d1fe6fab9d test/xobjtest.py
--- a/test/xobjtest.py	Fri Dec 12 15:43:35 2008 -0500
+++ b/test/xobjtest.py	Sun Dec 14 22:28:58 2008 -0500
@@ -128,7 +128,15 @@
 
         # asdf/fdsa have been dropped becuase text is dropped from
         # the complex class PropClass
-        self.assertNotEqual(o.tostring(), xmlText)
+        xmlOutText = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                   '<top>\n'
+                   '  <prop>\n'
+                   '    <subprop subattr="1"/>\n'
+                   '    <subprop subattr="2"/>\n'
+                   '  </prop>\n'
+                   '  <simple>simple</simple>\n'
+                   '</top>\n')
+        self.assertEqual(o.tostring(), xmlOutText)
 
 
     def testNamespaces(self):

From ewt@rpath.com Tue Dec 16 13:41:35 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBGDfZpi004874
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 13:41:35 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDfZ53025165
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:35 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBGDfYSP008822
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:34 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDfYkf029687
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:34 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBGDfYbN029672
	for xobj-commits@lists.rpath.com; Tue, 16 Dec 2008 08:41:34 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812161341.mBGDfYbN029672@scc.eng.rpath.com>
Date: Tue, 16 Dec 2008 08:41:34 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: added support for XID and XIDREF
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 16 Dec 2008 13:41:35 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

added support for XID and XIDREF

diff -r 182596c34039 -r 4fa6f74c1ec0 test/xobjtest.py
--- a/test/xobjtest.py	Fri Dec 12 15:43:35 2008 -0500
+++ b/test/xobjtest.py	Sat Dec 13 14:59:24 2008 -0500
@@ -187,6 +187,66 @@
         self.assertRaises(etree.XMLSyntaxError,
                           xobj.parsef, xml, schemaf = schema)
 
+    def testId(self):
+        s = (
+            '<top>\n'
+            '  <item id="theid" val="value"/>\n'
+            '  <ref other="theid"/>\n'
+            '</top>\n')
+        xml = StringIO(s)
+
+        class Ref(xobj.XObject):
+            other = xobj.XIDREF
+
+        class Top(xobj.XObject):
+            ref = Ref
+
+        class Document(xobj.Document):
+            top = Top
+
+        d = xobj.parsef(xml, documentClass = Document)
+        assert(d.top.ref.other == d.top.item)
+        s2 = d.tostring(xml_declaration = False)
+        self.assertEquals(s, s2)
+
+        # now test if the id is called something else
+        s = (
+            '<top>\n'
+            '  <item anid="theid" val="value"/>\n'
+            '  <ref other="theid"/>\n'
+            '</top>\n')
+        xml = StringIO(s)
+        try:
+            xobj.parsef(xml, documentClass = Document)
+        except xobj.XObjIdNotFound, e:
+            self.assertEquals(str(e), "XML ID 'theid' not found in document")
+        else:
+            assert(0)
+
+        class Item(xobj.XObject):
+            anid = xobj.XID
+        Top.item = Item
+
+        d = xobj.parsef(xml, documentClass = Document)
+        assert(d.top.ref.other == d.top.item)
+        s2 = d.tostring(xml_declaration = False)
+        self.assertEquals(s, s2)
+
+        # and test if the id isn't defined properly
+        class Top(xobj.XObject):
+            _attributes = set(['ref'])
+            ref = xobj.XIDREF
+        Document.top = Top
+
+        d = Document()
+        d.top = Top()
+        d.top.ref = xobj.XObjectStr('something')
+        try:
+            d.tostring()
+        except xobj.XObjSerializationException, e:
+            self.assertEquals(str(e), 'No id found for element referenced by ref')
+        else:
+            assert(0)
 
 if __name__ == "__main__":
     testsuite.main()
diff -r 182596c34039 -r 4fa6f74c1ec0 xobj/xobj.py
--- a/xobj/xobj.py	Fri Dec 12 15:43:35 2008 -0500
+++ b/xobj/xobj.py	Sat Dec 13 14:59:24 2008 -0500
@@ -52,21 +52,34 @@
     _elements = []
     _attributes = set()
 
-    def _setAttribute(self, key, val):
+    def _setAttribute(self, doc, key, val):
         expectedType = getattr(self.__class__, key, None)
         if expectedType:
             expectedXType = XTypeFromXObjectType(expectedType)
-            val = expectedXType.pythonType(val)
+            if (key == 'id' or key == 'xml_id' or
+                        issubclass(expectedXType.pythonType, XID)):
+                doc._ids[val] = self
+            elif issubclass(expectedXType.pythonType, XIDREF):
+                doc._idsNeeded.append((self, key, val))
+                return
+            else:
+                val = expectedXType.pythonType(val)
         else:
+            if (key == 'id' or key == 'xml_id'):
+                doc._ids[val] = self
+
             expectedXType = None
             val = XObjectStr(val)
 
+        self._addAttribute(key, val, xType = expectedXType)
+
+    def _addAttribute(self, key, val, xType = None):
         if not self._attributes:
             self._attributes = set([key])
         elif key not in self._attributes:
             self._attributes.add(key)
 
-        self._setItem(key, val, expectedXType)
+        self._setItem(key, val, xType)
 
     def _addElement(self, key, val, xType = None):
         self._setItem(key, val, xType = xType)
@@ -84,8 +97,10 @@
                 current = []
                 setattr(self, key, current)
 
-        if key not in self.__dict__:
-            # This has not yet been set in the instance.
+        if self.__dict__.get(key, None) is None:
+            # This has not yet been set in the instance (because it's missing) or it's been
+            # set to None (because we think we don't have this value but it's actually an idref
+            # being filled in later)
             setattr(self, key, val)
         elif type(current) == list:
             current.append(val)
@@ -108,6 +123,20 @@
         for key, val in self.__dict__.iteritems():
             if key[0] != '_':
                 if key in self._attributes:
+                    pythonType = getattr(self.__class__, key, None)
+                    if pythonType and issubclass(pythonType, XIDREF):
+                        idVal = getattr(val, 'id', None)
+                        if idVal is None:
+                            for idKey, idType in val.__class__.__dict__.iteritems():
+                                if (idKey[0] != '_' and type(idType) == type
+                                                and issubclass(idType, XID)):
+                                    idVal = getattr(val, idKey)
+
+                        if idVal is None:
+                            raise XObjSerializationException('No id found for element referenced by '
+                                                             '%s' % key)
+                        val = idVal
+
                     key = addns(key)
                     attrs[key] = str(val)
                 else:
@@ -146,12 +175,29 @@
     def __init__(self, text = None):
         self.text = text
 
+class XID(XObject):
+
+    pass
+
+class XIDREF(XObject):
+
+    pass
+
 class Document(XObject):
 
     nameSpaceMap = {}
+    _ids = None
+    _idsNeeded = None
+
+    def __init__(self):
+        self._idsNeeded = []
+        self._ids = {}
+        self.__explicitNamespaces = False
+        self.__xmlNsMap = {}
 
     def tostring(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
         for key, val in self.__dict__.iteritems():
+            if key[0] == '_': continue
             if isinstance(val, XObject):
                 break
 
@@ -161,6 +207,7 @@
         else:
             map = self.__xmlNsMap
 
+        import epdb;epdb.st('f')
         et = val.getElementTree(key, nsmap = map)
         xmlString = etree.tostring(et, pretty_print = prettyPrint,
                                    encoding = 'UTF-8',
@@ -230,7 +277,7 @@
             # handle attributes
             for (key, val) in element.items():
                 key = nsmap(key)
-                xobj._setAttribute(key, val)
+                xobj._setAttribute(self, key, val)
 
             # anything which is the same as in the class wasn't set in XML, so
             # set it to None
@@ -264,6 +311,11 @@
 
         parseElement(rootElement)
 
+        for (xobj, tag, theId) in self._idsNeeded:
+            if theId not in self._ids:
+                raise XObjIdNotFound(theId)
+            xobj._addAttribute(tag, self._ids[theId])
+
 class XObjectInt(XObject, int):
 
     pass
@@ -273,6 +325,18 @@
     pass
 
 class XObjParseException(Exception):
+
+    pass
+
+class XObjIdNotFound(XObjParseException):
+
+    def __str__(self):
+        return "XML ID '%s' not found in document" % self.theId
+
+    def __init__(self, theId):
+        self.theId = theId
+
+class XObjSerializationException(Exception):
 
     pass
 

From ewt@rpath.com Tue Dec 16 13:41:36 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBGDfaOK004877
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 13:41:36 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDfaPH025168
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:36 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBGDfZts008826
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:35 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDfZBp029728
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:35 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBGDfZVC029712
	for xobj-commits@lists.rpath.com; Tue, 16 Dec 2008 08:41:35 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812161341.mBGDfZVC029712@scc.eng.rpath.com>
Date: Tue, 16 Dec 2008 08:41:35 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: added a couple of tests to get 100% coverage
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 16 Dec 2008 13:41:36 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py

added a couple of tests to get 100% coverage

diff -r 4fa6f74c1ec0 -r c0fd7a6c2139 test/xobjtest.py
--- a/test/xobjtest.py	Sat Dec 13 14:59:24 2008 -0500
+++ b/test/xobjtest.py	Sat Dec 13 15:10:12 2008 -0500
@@ -46,6 +46,7 @@
         class TopClass(xobj.XObject):
             subelement = SubelementClass
             unused = str
+            attr1 = str
 
         class DocumentClass(xobj.Document):
             top = TopClass
@@ -248,5 +249,34 @@
         else:
             assert(0)
 
+    def testExplicitNamespaces(self):
+        s = (
+            '<top xmlns="http://somens.xsd" xmlns:ns="http://somens.xsd">\n'
+            '  <element ns:attr="foo"/>\n'
+            '</top>\n'
+            )
+        xml = StringIO(s)
+
+        d = xobj.parsef(xml)
+        assert(d.ns_top.ns_element.ns_attr == 'foo')
+        s2 = d.tostring(xml_declaration = False)
+
+        expecteds2 = (
+            '<ns:top xmlns:ns="http://somens.xsd">\n'
+            '  <ns:element ns:attr="foo"/>\n'
+            '</ns:top>\n'
+            )
+        assert(s2 == expecteds2)
+
+    def testUnknownType(self):
+        s ='<top/>'
+        xml = StringIO(s)
+
+        class Document(xobj.Document):
+            top = object
+
+        self.assertRaises(xobj.UnknownXType, xobj.parsef, xml,
+                          documentClass = Document)
+
 if __name__ == "__main__":
     testsuite.main()

From ewt@rpath.com Tue Dec 16 13:41:37 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBGDfb2j004886
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 13:41:37 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDfbdO025176
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:37 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBGDfbkp008830
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:37 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDfaPL029770
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:36 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBGDfaul029750
	for xobj-commits@lists.rpath.com; Tue, 16 Dec 2008 08:41:36 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812161341.mBGDfaul029750@scc.eng.rpath.com>
Date: Tue, 16 Dec 2008 08:41:36 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: added typeMap support
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 16 Dec 2008 13:41:38 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

added typeMap support

diff -r c0fd7a6c2139 -r 3c738c9bcb3e test/xobjtest.py
--- a/test/xobjtest.py	Sat Dec 13 15:10:12 2008 -0500
+++ b/test/xobjtest.py	Mon Dec 15 07:54:40 2008 -0500
@@ -278,5 +278,15 @@
         self.assertRaises(xobj.UnknownXType, xobj.parsef, xml,
                           documentClass = Document)
 
+    def testTypeMap(self):
+        s ='<top><item val="3"/></top>'
+        xml = StringIO(s)
+
+        class D(xobj.Document):
+            typeMap = { 'val' : int }
+
+        d = xobj.parsef(xml, documentClass = D)
+        assert(d.top.item.val == 3)
+
 if __name__ == "__main__":
     testsuite.main()
diff -r c0fd7a6c2139 -r 3c738c9bcb3e xobj/xobj.py
--- a/xobj/xobj.py	Sat Dec 13 15:10:12 2008 -0500
+++ b/xobj/xobj.py	Mon Dec 15 07:54:40 2008 -0500
@@ -54,6 +54,9 @@
 
     def _setAttribute(self, doc, key, val):
         expectedType = getattr(self.__class__, key, None)
+        if expectedType is None:
+            expectedType = doc.typeMap.get(key, None)
+
         if expectedType:
             expectedXType = XTypeFromXObjectType(expectedType)
             if (key == 'id' or key == 'xml_id' or
@@ -186,8 +189,7 @@
 class Document(XObject):
 
     nameSpaceMap = {}
-    _ids = None
-    _idsNeeded = None
+    typeMap = {}
 
     def __init__(self):
         self._idsNeeded = []
@@ -247,6 +249,9 @@
             thisXType = None
             if parentXType:
                 thisPyType = getattr(parentXType.pythonType, tag, None)
+                if not thisPyType:
+                    thisPyType = self.typeMap.get(tag, None)
+
                 if thisPyType:
                     thisXType = XTypeFromXObjectType(thisPyType)
 

From ewt@rpath.com Tue Dec 16 13:41:40 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBGDfevv004892
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 13:41:40 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDfdjR025184
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:39 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBGDfdSp008840
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:39 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDfddV029802
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:39 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBGDfd8s029791
	for xobj-commits@lists.rpath.com; Tue, 16 Dec 2008 08:41:39 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812161341.mBGDfd8s029791@scc.eng.rpath.com>
Date: Tue, 16 Dec 2008 08:41:38 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: unused list items should be [], not None
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 16 Dec 2008 13:41:40 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/testsuite.py test/xobjtest.py xobj/xobj.py

unused list items should be [], not None
added parse()
allow parse, parsef to take typeMap overrides as well as document classes

diff -r 3c738c9bcb3e -r d04552b00bfd test/testsuite.py
--- a/test/testsuite.py	Mon Dec 15 07:54:40 2008 -0500
+++ b/test/testsuite.py	Mon Dec 15 08:08:15 2008 -0500
@@ -83,8 +83,8 @@
     sys.exit(not results.wasSuccessful())
 
 if __name__ == '__main__':
-    testDir = os.path.dirname(__file__)
-    if not os.path.exists(testDir + '/conarytest/testsetup.py'):
-        print "Executing makefile to create required symlinks..."
-        os.system('make')
+    #testDir = os.path.dirname(__file__)
+    #if not os.path.exists(testDir + '/conarytest/testsetup.py'):
+    #    print "Executing makefile to create required symlinks..."
+    #    os.system('make')
     main(sys.argv, individual=False)
diff -r 3c738c9bcb3e -r d04552b00bfd test/xobjtest.py
--- a/test/xobjtest.py	Mon Dec 15 07:54:40 2008 -0500
+++ b/test/xobjtest.py	Mon Dec 15 08:08:15 2008 -0500
@@ -103,7 +103,7 @@
 
         class SubpropClass(xobj.XObject):
             subattr = int
-            unused = [ str ]
+            unused = str
 
         class PropClass(xobj.XObject):
             subprop = [ SubpropClass ]
@@ -288,5 +288,12 @@
         d = xobj.parsef(xml, documentClass = D)
         assert(d.top.item.val == 3)
 
+    def testEmptyList(self):
+        class Top(xobj.XObject):
+            l = []
+
+        d = xobj.parse("<top/>", typeMap = { 'top' : Top })
+        assert(d.top.l == [])
+
 if __name__ == "__main__":
     testsuite.main()
diff -r 3c738c9bcb3e -r d04552b00bfd xobj/xobj.py
--- a/xobj/xobj.py	Mon Dec 15 07:54:40 2008 -0500
+++ b/xobj/xobj.py	Mon Dec 15 08:08:15 2008 -0500
@@ -209,7 +209,6 @@
         else:
             map = self.__xmlNsMap
 
-        import epdb;epdb.st('f')
         et = val.getElementTree(key, nsmap = map)
         xmlString = etree.tostring(et, pretty_print = prettyPrint,
                                    encoding = 'UTF-8',
@@ -289,7 +288,10 @@
             for key, val in xobj.__class__.__dict__.items():
                 if key[0] == '_': continue
                 if getattr(xobj, key) == val:
-                    setattr(xobj, key, None)
+                    if type(val) == list:
+                        setattr(xobj, key, [])
+                    else:
+                        setattr(xobj, key, None)
 
             if parentXObj is not None:
                 parentXObj._addElement(tag, xobj, thisXType)
@@ -345,19 +347,27 @@
 
     pass
 
-def parsef(f, schemaf = None, documentClass = None):
+def parsef(f, schemaf = None, documentClass = Document, typeMap = {}):
     if schemaf:
         schemaObj = etree.XMLSchema(etree.parse(schemaf))
     else:
         schemaObj = None
 
-    if documentClass is None:
-        documentClass = Document
-
-    document = documentClass()
+    if typeMap:
+        newClass = type('XObj_Dynamic_Document', (documentClass,),
+                        { 'typeMap' : typeMap})
+        document = newClass()
+    else:
+        document = documentClass()
 
     parser = etree.XMLParser(schema = schemaObj)
     xml = etree.parse(f, parser)
     document.fromElementTree(xml)
 
     return document
+
+def parse(s, schemaf = None, documentClass = Document, typeMap = {}):
+    s = StringIO(s)
+    return parsef(s, schemaf, documentClass = documentClass, typeMap = typeMap)
+
+

From ewt@rpath.com Tue Dec 16 13:41:41 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBGDffDw004895
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 13:41:41 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDfeHG025190
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:40 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBGDfeXu008845
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:40 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDfeis029846
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:40 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBGDfeGW029832
	for xobj-commits@lists.rpath.com; Tue, 16 Dec 2008 08:41:40 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812161341.mBGDfeGW029832@scc.eng.rpath.com>
Date: Tue, 16 Dec 2008 08:41:40 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: 1. made type map's work for elements, not just
 attributes
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 16 Dec 2008 13:41:41 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

1. made type map's work for elements, not just attributes
2. test that Document class is used when no type map or alternate class is
given

diff -r d04552b00bfd -r 349476ea5d4b test/xobjtest.py
--- a/test/xobjtest.py	Mon Dec 15 08:08:15 2008 -0500
+++ b/test/xobjtest.py	Mon Dec 15 08:16:53 2008 -0500
@@ -259,6 +259,7 @@
 
         d = xobj.parsef(xml)
         assert(d.ns_top.ns_element.ns_attr == 'foo')
+        assert(d.__class__ == xobj.Document)
         s2 = d.tostring(xml_declaration = False)
 
         expecteds2 = (
@@ -288,6 +289,12 @@
         d = xobj.parsef(xml, documentClass = D)
         assert(d.top.item.val == 3)
 
+        class I(xobj.XObject):
+            val = int
+
+        d = xobj.parsef(xml, typeMap = { 'item' : I} )
+        assert(d.top.item.val == 3)
+
     def testEmptyList(self):
         class Top(xobj.XObject):
             l = []
diff -r d04552b00bfd -r 349476ea5d4b xobj/xobj.py
--- a/xobj/xobj.py	Mon Dec 15 08:08:15 2008 -0500
+++ b/xobj/xobj.py	Mon Dec 15 08:16:53 2008 -0500
@@ -246,13 +246,16 @@
                 parentXType = XTypeFromXObjectType(self.__class__)
 
             thisXType = None
+            thisPyType = None
+
             if parentXType:
                 thisPyType = getattr(parentXType.pythonType, tag, None)
-                if not thisPyType:
-                    thisPyType = self.typeMap.get(tag, None)
 
-                if thisPyType:
-                    thisXType = XTypeFromXObjectType(thisPyType)
+            if not thisPyType:
+                thisPyType = self.typeMap.get(tag, None)
+
+            if thisPyType:
+                thisXType = XTypeFromXObjectType(thisPyType)
 
             if thisXType:
                 if text is not None and thisXType._isComplex():

From ewt@rpath.com Tue Dec 16 13:41:42 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBGDfg93004899
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 13:41:42 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDffxZ025194
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:41 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBGDffTF008848
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:41 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBGDffmZ029878
	for <xobj-commits@lists.rpath.com>; Tue, 16 Dec 2008 08:41:41 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBGDffsD029873
	for xobj-commits@lists.rpath.com; Tue, 16 Dec 2008 08:41:41 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812161341.mBGDffsD029873@scc.eng.rpath.com>
Date: Tue, 16 Dec 2008 08:41:41 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: branch merge
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 16 Dec 2008 13:41:42 -0000

tag:         tip
user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py

branch merge

diff -r 349476ea5d4b -r a27b9452abeb test/xobjtest.py
--- a/test/xobjtest.py	Mon Dec 15 08:16:53 2008 -0500
+++ b/test/xobjtest.py	Tue Dec 16 08:41:17 2008 -0500
@@ -129,7 +129,15 @@
 
         # asdf/fdsa have been dropped becuase text is dropped from
         # the complex class PropClass
-        self.assertNotEqual(o.tostring(), xmlText)
+        xmlOutText = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                   '<top>\n'
+                   '  <prop>\n'
+                   '    <subprop subattr="1"/>\n'
+                   '    <subprop subattr="2"/>\n'
+                   '  </prop>\n'
+                   '  <simple>simple</simple>\n'
+                   '</top>\n')
+        self.assertEqual(o.tostring(), xmlOutText)
 
 
     def testNamespaces(self):

From ewt@rpath.com Thu Dec 18 15:38:17 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBIFcHIm016314
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:38:17 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBIFcHED001298
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 10:38:17 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBIFcG3d023413
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 10:38:16 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBIFcGvw016301
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 10:38:16 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBIFcG6F016283
	for xobj-commits@lists.rpath.com; Thu, 18 Dec 2008 10:38:16 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812181538.mBIFcG6F016283@scc.eng.rpath.com>
Date: Thu, 18 Dec 2008 10:38:16 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: reuse dynamically created classes based on the tag name;
	this speeds up
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Dec 2008 15:38:17 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       test/xobjtest.py xobj/xobj.py

reuse dynamically created classes based on the tag name; this speeds up
parsing large xml hunks by 75%

diff -r a27b9452abeb -r 7935b2396d1a test/xobjtest.py
--- a/test/xobjtest.py	Tue Dec 16 08:41:17 2008 -0500
+++ b/test/xobjtest.py	Tue Dec 16 19:48:00 2008 -0500
@@ -98,6 +98,8 @@
         for i in range(2):
             self.assertEqual(o.top.prop.subprop[i].__class__.__name__,
                              'subprop_XObj_Type')
+        assert(o.top.prop.subprop[0].__class__ ==
+               o.top.prop.subprop[1].__class__)
 
         # ---
 
diff -r a27b9452abeb -r 7935b2396d1a xobj/xobj.py
--- a/xobj/xobj.py	Tue Dec 16 08:41:17 2008 -0500
+++ b/xobj/xobj.py	Tue Dec 16 19:48:00 2008 -0500
@@ -193,6 +193,7 @@
 
     def __init__(self):
         self._idsNeeded = []
+        self._dynamicClassDict = {}
         self._ids = {}
         self.__explicitNamespaces = False
         self.__xmlNsMap = {}
@@ -241,21 +242,26 @@
 
             tag = nsmap(element.tag)
 
-            if parentXObj is None:
-                parentXObj = self
-                parentXType = XTypeFromXObjectType(self.__class__)
+            if tag in self._dynamicClassDict:
+                thisXType = self._dynamicClassDict[tag]
+            else:
+                if parentXObj is None:
+                    parentXObj = self
+                    parentXType = XTypeFromXObjectType(self.__class__)
 
-            thisXType = None
-            thisPyType = None
+                thisXType = None
+                thisPyType = None
 
-            if parentXType:
-                thisPyType = getattr(parentXType.pythonType, tag, None)
+                if parentXType:
+                    thisPyType = getattr(parentXType.pythonType, tag, None)
 
-            if not thisPyType:
-                thisPyType = self.typeMap.get(tag, None)
+                if not thisPyType:
+                    thisPyType = self.typeMap.get(tag, None)
 
-            if thisPyType:
-                thisXType = XTypeFromXObjectType(thisPyType)
+                if thisPyType:
+                    thisXType = XTypeFromXObjectType(thisPyType)
+
+                self._dynamicClassDict[tag] = thisXType
 
             if thisXType:
                 if text is not None and thisXType._isComplex():
@@ -272,6 +278,7 @@
                 else:
                     NewClass = type(localTag + '_XObj_Type', (XObjectStr,), {})
                 xobj = NewClass(text)
+                self._dynamicClassDict[tag] = XType(NewClass)
 
             # handle children
             for childElement in element.getchildren():

From ewt@rpath.com Thu Dec 18 15:38:22 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBIFcMld016320
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:38:22 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBIFcLow001306
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 10:38:21 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBIFcHIw023416
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 10:38:17 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBIFcHj0016328
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 10:38:17 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBIFcH1u016320
	for xobj-commits@lists.rpath.com; Thu, 18 Dec 2008 10:38:17 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812181538.mBIFcH1u016320@scc.eng.rpath.com>
Date: Thu, 18 Dec 2008 10:38:17 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: reorganize archive to allow as3 integration
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Dec 2008 15:38:22 -0000

tag:         tip
user:        Erik Troan <http://issues.rpath.com>
files:       py/test/Makefile py/test/bootstrap.py py/test/testsuite.py py/test/xobjtest.py py/xobj/__init__.py py/xobj/xmlschema.py py/xobj/xobj.py test/Makefile test/bootstrap.py test/testsuite.py test/xobjtest.py xobj/__init__.py xobj/xmlschema.py xobj/xobj.py

reorganize archive to allow as3 integration

diff -r 7935b2396d1a -r adf52f88ca45 py/test/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/py/test/Makefile	Thu Dec 18 10:37:53 2008 -0500
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2004-2006 rPath, Inc.
+# All rights reserved
+#
+
+SUBDIRS=
+
+.PHONY: clean test debug-test
+
+dist_files = *.py Makefile archive/*
+
+all:
+	for dir in `find . -type d -name '*test' | fgrep -v .hg`; do \
+relativelink=`echo "$$dir" | sed s,/[^/]*,/..,g | sed 's,./,,'`; \
+ln -fs $${relativelink}/testsetup.py $$dir; \
+done
+
+install:
+	echo "nothing to install"
+
+test:
+	python2.4 testsuite.py
+
+debug-test:
+	python2.4 testsuite.py --debug
+
+clean: clean-coverage
+	@find . \( -name \*~ -o -name \*.pyc \) -exec rm -fv {} \;
+	for dir in `find . -type d -name '*test'`; do \
+            rm -f $${dir}/testsetup.py*;\
+        done
+
+clean-coverage:
+	@find . \( -name \*,cover \) -exec rm -fv {} \;
+	@rm -rf .coverage
+
diff -r 7935b2396d1a -r adf52f88ca45 py/test/bootstrap.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/py/test/bootstrap.py	Thu Dec 18 10:37:53 2008 -0500
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+
+import os
+import sys
+
+testUtilDir = os.environ.get('TESTUTILS_PATH', '../testutils')
+if os.path.exists(testUtilDir):
+    sys.path.insert(0, testUtilDir)
+
+try:
+    import testrunner
+except ImportError:
+    raise RuntimeError('Could not find testrunner - set TESTUTILS_PATH')
diff -r 7935b2396d1a -r adf52f88ca45 py/test/testsuite.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/py/test/testsuite.py	Thu Dec 18 10:37:53 2008 -0500
@@ -0,0 +1,90 @@
+#!/usr/bin/python
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
+import os
+import sys
+import unittest
+
+import bootstrap
+from testrunner import testhelp
+from testrunner import resources, testhandler
+
+#from pychecker import checker
+
+_setupPath = None
+
+def setup():
+    """
+    Setup initializes variables must be initialized before the testsuite
+    can be run.  Generally this means setting up and determining paths.
+    """
+    global _setupPath
+    if _setupPath:
+        return _setupPath
+
+    xobjPath = testhelp.getPath('XOBJ_PATH')
+    os.environ['XOBJ_PATH'] = xobjPath
+    for path in xobjPath.split(':'):
+        if not os.path.isdir(path):
+            print 'XOBJ_PATH %s does not exist' %path
+            sys.exit(1)
+    testhelp.insertPath(testhelp.getPath('XOBJ_PATH'), updatePythonPath=True)
+
+    from testrunner import testSetup
+    testSetup.setup()
+
+    from conary.lib import util
+    sys.excepthook = util.genExcepthook(True, catchSIGUSR1=False)
+
+    testhelp._conaryDir = resources.conaryDir
+    _setupPath = path
+    return path
+
+def main(argv=None, individual=True):
+    cfg = resources.cfg
+    cfg.isIndividual = individual
+
+    setup()
+
+    cfg.cleanTestDirs = not individual
+    cfg.coverageExclusions = ['scripts/.*', 'epdb.py', 'stackutil.py',
+                              'test/.*']
+    cfg.coverageDirs = [ os.environ['XOBJ_PATH'] ]
+
+    if argv is None:
+        argv = list(sys.argv)
+    topdir = testhelp.getTestPath()
+    if topdir not in sys.path:
+        sys.path.insert(0, topdir)
+    cwd = os.getcwd()
+    if cwd != topdir and cwd not in sys.path:
+        sys.path.insert(0, cwd)
+
+
+
+    from conary.lib import util
+    from conary.lib import coveragehook
+    sys.excepthook = util.genExcepthook(True, catchSIGUSR1=False)
+
+    handler = testhandler.TestSuiteHandler(cfg, resources)
+    print "This process PID:", os.getpid()
+    results = handler.main(argv)
+    if results is None:
+        sys.exit(0)
+    sys.exit(not results.wasSuccessful())
+
+if __name__ == '__main__':
+    #testDir = os.path.dirname(__file__)
+    #if not os.path.exists(testDir + '/conarytest/testsetup.py'):
+    #    print "Executing makefile to create required symlinks..."
+    #    os.system('make')
+    main(sys.argv, individual=False)
diff -r 7935b2396d1a -r adf52f88ca45 py/test/xobjtest.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/py/test/xobjtest.py	Thu Dec 18 10:37:53 2008 -0500
@@ -0,0 +1,316 @@
+#!/usr/bin/python
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
+
+import types
+
+import testsuite
+testsuite.setup()
+from testrunner import testhelp
+from lxml import etree
+
+from xobj import xobj
+from StringIO import StringIO
+
+class XobjTest(testhelp.TestCase):
+
+    def testSimpleParse(self):
+        xml = StringIO('<top attr1="anattr" attr2="another">\n'
+                       '    <!-- comment -->'
+                       '    <prop>something</prop>\n'
+                       '    <subelement subattr="2"/>\n'
+                       '</top>\n')
+        o = xobj.parsef(xml)
+        self.assertEqual(o.top.__class__.__name__, 'top_XObj_Type')
+        self.assertEqual(o.top.attr1, 'anattr')
+        self.assertEqual(o.top.attr2, 'another')
+        self.assertEqual(o.top.prop, 'something')
+        self.assertEqual(o.top.subelement.subattr, '2')
+        self.assertEqual(o.top.subelement.__class__.__name__,
+                         'subelement_XObj_Type')
+
+        # ---
+
+        class SubelementClass(xobj.XObject):
+            subattr = int
+
+        class TopClass(xobj.XObject):
+            subelement = SubelementClass
+            unused = str
+            attr1 = str
+
+        class DocumentClass(xobj.Document):
+            top = TopClass
+
+        o = xobj.parsef(xml, documentClass = DocumentClass)
+        self.assertEqual(o.top.subelement.subattr, 2)
+        self.assertEqual(o.top.unused, None)
+
+        # ---
+
+        class SubelementClass(xobj.XObject):
+            subattr = [ int ]
+        TopClass.subelement = SubelementClass
+
+        o = xobj.parsef(xml, documentClass = DocumentClass)
+        self.assertEqual(o.top.subelement.subattr, [ 2 ] )
+
+        # ---
+
+        TopClass.subelement = [ SubelementClass ]
+        o = xobj.parsef(xml, documentClass = DocumentClass)
+        self.assertEqual(o.top.subelement[0].subattr, [ 2] )
+
+    def testComplexParse(self):
+        xmlText = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                   '<top>\n'
+                   '  <prop>\n'
+                   '    <subprop subattr="1">asdf</subprop>\n'
+                   '    <subprop subattr="2">fdsa</subprop>\n'
+                   '  </prop>\n'
+                   '  <simple>simple</simple>\n'
+                   '</top>\n')
+        xml = StringIO(xmlText)
+        o = xobj.parsef(xml)
+
+        # ---
+
+        self.assertEqual(o.tostring(), xmlText)
+
+        # ---
+
+        self.assertEqual(o.top.__class__.__name__, 'top_XObj_Type')
+        self.assertEqual(type(o.top.prop.subprop), types.ListType)
+        self.assertEqual(o.top.prop.subprop, ['asdf', 'fdsa'])
+        asdf = o.top.prop.subprop[0]
+        self.assertEqual(asdf.__class__.__name__, 'subprop_XObj_Type')
+        self.assertEqual(o.top.prop.__class__.__name__,
+                         'prop_XObj_Type')
+        for i in range(2):
+            self.assertEqual(o.top.prop.subprop[i].__class__.__name__,
+                             'subprop_XObj_Type')
+        assert(o.top.prop.subprop[0].__class__ ==
+               o.top.prop.subprop[1].__class__)
+
+        # ---
+
+        class SubpropClass(xobj.XObject):
+            subattr = int
+            unused = str
+
+        class PropClass(xobj.XObject):
+            subprop = [ SubpropClass ]
+
+        class SimpleClass(xobj.XObject):
+            pass
+
+        class TopClass(xobj.XObject):
+            unused = str
+            prop = PropClass
+            simple = [ SimpleClass ]
+
+        class DocumentClass(xobj.Document):
+            top = TopClass
+
+        o = xobj.parsef(xml, documentClass = DocumentClass)
+        self.assertEqual(o.top.prop.subprop[1].subattr, 2)
+        self.assertEqual(o.top.unused, None)
+        self.assertEqual(o.top.prop.subprop[0].unused, None)
+        self.assertEqual(o.top.simple[0].text, 'simple')
+
+        # ---
+
+        # asdf/fdsa have been dropped becuase text is dropped from
+        # the complex class PropClass
+        xmlOutText = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                   '<top>\n'
+                   '  <prop>\n'
+                   '    <subprop subattr="1"/>\n'
+                   '    <subprop subattr="2"/>\n'
+                   '  </prop>\n'
+                   '  <simple>simple</simple>\n'
+                   '</top>\n')
+        self.assertEqual(o.tostring(), xmlOutText)
+
+
+    def testNamespaces(self):
+        xmlString = ('<top xmlns="http://this" xmlns:other="http://other/other"'
+                        ' xmlns:other2="http://other/other2">\n'
+                     '  <local/>\n'
+                     '  <other:tag other:val="1"/>\n'
+                     '  <other2:tag val="2"/>\n'
+                     '</top>\n')
+        xml = StringIO(xmlString)
+        o = xobj.parsef(xml)
+        assert(o.top.other_tag.other_val == '1')
+        assert(o.top.other2_tag.val == '2')
+        assert(o.tostring(xml_declaration = False) == xmlString)
+
+        class Top(xobj.Document):
+            nameSpaceMap = { 'other3' : 'http://other/other2' }
+
+        o = xobj.parsef(xml, documentClass = Top)
+        assert(o.top.other_tag.other_val == '1')
+        assert(o.top.other3_tag.val == '2')
+        newXmlString = xmlString.replace("other2:", "other3:")
+        newXmlString = newXmlString.replace(":other2", ":other3")
+        assert(o.tostring(xml_declaration = False) == newXmlString)
+
+    def testSchemaValidation(self):
+        s = (
+            '<?xml version="1.0" encoding="UTF-8"?>\n'
+            '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">\n'
+            '   <xs:element name="top">\n'
+            '    <xs:complexType>\n'
+            '      <xs:sequence>\n'
+            '        <xs:element name="prop" type="xs:string"/>\n'
+            '        <xs:element name="subelement">\n'
+            '          <xs:complexType>\n'
+            '          <xs:attribute name="subattr" type="xs:integer"/>\n'
+            '          </xs:complexType>\n'
+            '        </xs:element>\n'
+            '      </xs:sequence>\n'
+            '      <xs:attribute name="attr" type="xs:string"/>\n'
+            '    </xs:complexType>\n'
+            '  </xs:element>\n'
+            '</xs:schema>\n')
+        schema = StringIO(s)
+
+        s = (
+            '<top attr="anattr">\n'
+            '  <prop>something</prop>\n'
+            '  <subelement subattr="2"/>\n'
+            '</top>\n')
+        xml = StringIO(s)
+        xobj.parsef(xml, schemaf = schema)
+
+        xml = StringIO(s.replace('prop', 'prop2'))
+        xobj.parsef(xml)
+        self.assertRaises(etree.XMLSyntaxError,
+                          xobj.parsef, xml, schemaf = schema)
+
+    def testId(self):
+        s = (
+            '<top>\n'
+            '  <item id="theid" val="value"/>\n'
+            '  <ref other="theid"/>\n'
+            '</top>\n')
+        xml = StringIO(s)
+
+        class Ref(xobj.XObject):
+            other = xobj.XIDREF
+
+        class Top(xobj.XObject):
+            ref = Ref
+
+        class Document(xobj.Document):
+            top = Top
+
+        d = xobj.parsef(xml, documentClass = Document)
+        assert(d.top.ref.other == d.top.item)
+        s2 = d.tostring(xml_declaration = False)
+        self.assertEquals(s, s2)
+
+        # now test if the id is called something else
+        s = (
+            '<top>\n'
+            '  <item anid="theid" val="value"/>\n'
+            '  <ref other="theid"/>\n'
+            '</top>\n')
+        xml = StringIO(s)
+        try:
+            xobj.parsef(xml, documentClass = Document)
+        except xobj.XObjIdNotFound, e:
+            self.assertEquals(str(e), "XML ID 'theid' not found in document")
+        else:
+            assert(0)
+
+        class Item(xobj.XObject):
+            anid = xobj.XID
+        Top.item = Item
+
+        d = xobj.parsef(xml, documentClass = Document)
+        assert(d.top.ref.other == d.top.item)
+        s2 = d.tostring(xml_declaration = False)
+        self.assertEquals(s, s2)
+
+        # and test if the id isn't defined properly
+        class Top(xobj.XObject):
+            _attributes = set(['ref'])
+            ref = xobj.XIDREF
+        Document.top = Top
+
+        d = Document()
+        d.top = Top()
+        d.top.ref = xobj.XObjectStr('something')
+        try:
+            d.tostring()
+        except xobj.XObjSerializationException, e:
+            self.assertEquals(str(e), 'No id found for element referenced by ref')
+        else:
+            assert(0)
+
+    def testExplicitNamespaces(self):
+        s = (
+            '<top xmlns="http://somens.xsd" xmlns:ns="http://somens.xsd">\n'
+            '  <element ns:attr="foo"/>\n'
+            '</top>\n'
+            )
+        xml = StringIO(s)
+
+        d = xobj.parsef(xml)
+        assert(d.ns_top.ns_element.ns_attr == 'foo')
+        assert(d.__class__ == xobj.Document)
+        s2 = d.tostring(xml_declaration = False)
+
+        expecteds2 = (
+            '<ns:top xmlns:ns="http://somens.xsd">\n'
+            '  <ns:element ns:attr="foo"/>\n'
+            '</ns:top>\n'
+            )
+        assert(s2 == expecteds2)
+
+    def testUnknownType(self):
+        s ='<top/>'
+        xml = StringIO(s)
+
+        class Document(xobj.Document):
+            top = object
+
+        self.assertRaises(xobj.UnknownXType, xobj.parsef, xml,
+                          documentClass = Document)
+
+    def testTypeMap(self):
+        s ='<top><item val="3"/></top>'
+        xml = StringIO(s)
+
+        class D(xobj.Document):
+            typeMap = { 'val' : int }
+
+        d = xobj.parsef(xml, documentClass = D)
+        assert(d.top.item.val == 3)
+
+        class I(xobj.XObject):
+            val = int
+
+        d = xobj.parsef(xml, typeMap = { 'item' : I} )
+        assert(d.top.item.val == 3)
+
+    def testEmptyList(self):
+        class Top(xobj.XObject):
+            l = []
+
+        d = xobj.parse("<top/>", typeMap = { 'top' : Top })
+        assert(d.top.l == [])
+
+if __name__ == "__main__":
+    testsuite.main()
diff -r 7935b2396d1a -r adf52f88ca45 py/xobj/__init__.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/py/xobj/__init__.py	Thu Dec 18 10:37:53 2008 -0500
@@ -0,0 +1,10 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
diff -r 7935b2396d1a -r adf52f88ca45 py/xobj/xmlschema.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/py/xobj/xmlschema.py	Thu Dec 18 10:37:53 2008 -0500
@@ -0,0 +1,116 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+
+def smiter(item):
+    if hasattr(item, '__iter__'):
+        return item
+    else:
+        return [ item ]
+
+class AbstractSchemaMember(object):
+
+    pass
+
+class SchemaType(AbstractSchemaMember):
+
+    @staticmethod
+    def fromString(x):
+        return x
+
+class EmptyType(SchemaType):
+
+    pass
+
+class StringType(SchemaType):
+
+    pass
+
+class IntegerType(SchemaType):
+
+    @staticmethod
+    def fromString(x):
+        return int(x)
+
+class SequenceType(AbstractSchemaMember):
+
+    def findElement(self, name):
+        for x in self.elements:
+            if x.name == name:
+                return x
+
+        return None
+
+    def __init__(self, xobjSeq):
+        self.elements = [ SchemaElement(x)
+                                for x in smiter(xobjSeq.xsd_element) ]
+
+class Attribute(AbstractSchemaMember):
+
+    def getType(self):
+        return self.xtype
+
+    def __init__(self, name, xtype):
+        self.name = name
+        self.xtype = xtype
+
+class SchemaElement(AbstractSchemaMember):
+
+    def getType(self):
+        return self.xtype
+
+    def findAttribute(self, name):
+        return self.attributes.get(name, None)
+
+    def __init__(self, xobjElement):
+
+        def findSimpleType(typeStr):
+            if typeStr == 'xs:integer':
+                return IntegerType
+            elif typeStr == 'xs:string':
+                return StringType
+
+            return None
+
+        self.name = xobjElement.name
+        self.xtype = None
+        self.attributes = {}
+        attributes = None
+
+        # is this a type?
+        if hasattr(xobjElement, 'xsd_complexType'):
+            xobjType = xobjElement.xsd_complexType
+            attributes = getattr(xobjType, 'xsd_attribute', None)
+            if hasattr(xobjType, 'xsd_sequence'):
+                self.xtype = SequenceType(xobjType.xsd_sequence)
+            else:
+                self.xtype = EmptyType()
+        elif hasattr(xobjElement, 'type'):
+            self.xtype = findSimpleType(xobjElement.type)
+        else:
+            assert(0)
+
+
+        if attributes:
+            for attr in smiter(attributes):
+                self.attributes[attr.name] = Attribute(
+                                        attr.name, findSimpleType(attr.type))
+
+
+class Schema(SequenceType):
+
+    def __init__(self, xobjSchema):
+        # xobjSchema is a schema; it's children are global
+
+        # XXX parse global types
+        # XXX parse global attributes
+        SequenceType.__init__(self, xobjSchema)
+
+
diff -r 7935b2396d1a -r adf52f88ca45 py/xobj/xobj.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/py/xobj/xobj.py	Thu Dec 18 10:37:53 2008 -0500
@@ -0,0 +1,383 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+
+from lxml import etree
+import xmlschema
+import types
+from StringIO import StringIO
+
+class UnknownXType(Exception):
+
+    pass
+
+class XType(object):
+
+    def _isComplex(self):
+        for key in self.pythonType.__dict__.iterkeys():
+            if key[0] != '_':
+                return True
+
+        return False
+
+    def __init__(self, pythonType, forceList = False):
+        self.pythonType = pythonType
+        self.forceList = forceList
+
+def XTypeFromXObjectType(xObjectType):
+
+    if (type(xObjectType) == type and
+            issubclass(xObjectType, XObject)):
+        return XType(xObjectType)
+    elif xObjectType == int:
+        return XType(XObjectInt)
+    elif xObjectType == str:
+        return XType(str)
+    elif type(xObjectType) == list:
+        assert(len(xObjectType) == 1)
+        return XType(XTypeFromXObjectType(xObjectType[0]).pythonType,
+                     forceList = True)
+
+    raise UnknownXType
+
+class XObject(object):
+
+    _elements = []
+    _attributes = set()
+
+    def _setAttribute(self, doc, key, val):
+        expectedType = getattr(self.__class__, key, None)
+        if expectedType is None:
+            expectedType = doc.typeMap.get(key, None)
+
+        if expectedType:
+            expectedXType = XTypeFromXObjectType(expectedType)
+            if (key == 'id' or key == 'xml_id' or
+                        issubclass(expectedXType.pythonType, XID)):
+                doc._ids[val] = self
+            elif issubclass(expectedXType.pythonType, XIDREF):
+                doc._idsNeeded.append((self, key, val))
+                return
+            else:
+                val = expectedXType.pythonType(val)
+        else:
+            if (key == 'id' or key == 'xml_id'):
+                doc._ids[val] = self
+
+            expectedXType = None
+            val = XObjectStr(val)
+
+        self._addAttribute(key, val, xType = expectedXType)
+
+    def _addAttribute(self, key, val, xType = None):
+        if not self._attributes:
+            self._attributes = set([key])
+        elif key not in self._attributes:
+            self._attributes.add(key)
+
+        self._setItem(key, val, xType)
+
+    def _addElement(self, key, val, xType = None):
+        self._setItem(key, val, xType = xType)
+        if not self._elements:
+            self._elements = [ key ]
+        elif key not in self._elements:
+            self._elements.append(key)
+
+    def _setItem(self, key, val, xType = None):
+        current = getattr(self, key, None)
+        if xType and xType.forceList:
+            # force the item to be a list, and use the type inside of
+            # this list as the type of elements of the list
+            if key not in self.__dict__:
+                current = []
+                setattr(self, key, current)
+
+        if self.__dict__.get(key, None) is None:
+            # This has not yet been set in the instance (because it's missing) or it's been
+            # set to None (because we think we don't have this value but it's actually an idref
+            # being filled in later)
+            setattr(self, key, val)
+        elif type(current) == list:
+            current.append(val)
+        else:
+            setattr(self, key, [ current, val ])
+
+    def getElementTree(self, tag, rootElement = None, nsmap = {}):
+
+        def addns(s):
+            for short, long in nsmap.iteritems():
+                if short and s.startswith(short + '_'):
+                    s = '{' + long + '}' + s[len(short) + 1:]
+
+            return s
+
+        tag = addns(tag)
+
+        attrs = {}
+        elements = {}
+        for key, val in self.__dict__.iteritems():
+            if key[0] != '_':
+                if key in self._attributes:
+                    pythonType = getattr(self.__class__, key, None)
+                    if pythonType and issubclass(pythonType, XIDREF):
+                        idVal = getattr(val, 'id', None)
+                        if idVal is None:
+                            for idKey, idType in val.__class__.__dict__.iteritems():
+                                if (idKey[0] != '_' and type(idType) == type
+                                                and issubclass(idType, XID)):
+                                    idVal = getattr(val, idKey)
+
+                        if idVal is None:
+                            raise XObjSerializationException('No id found for element referenced by '
+                                                             '%s' % key)
+                        val = idVal
+
+                    key = addns(key)
+                    attrs[key] = str(val)
+                else:
+                    l = elements.setdefault(key, [])
+                    l.append(val)
+
+        orderedElements = []
+        if self._elements:
+            for name in self._elements:
+                for val in elements[name]:
+                    orderedElements.append((name, val))
+            for name in (set(elements) - set(self._elements)):
+                for val in elements[name]:
+                    orderedElements.append((name, val))
+
+        if rootElement is None:
+            element = etree.Element(tag, attrs, nsmap = nsmap)
+        else:
+            element = etree.SubElement(rootElement, tag, attrs)
+
+        if self.text is not None:
+            element.text = self.text
+
+        for key, val in orderedElements:
+            if val is not None:
+                if type(val) == list:
+                    for subval in val:
+                        subval.getElementTree(key, rootElement = element,
+                                              nsmap = nsmap)
+                else:
+                    val.getElementTree(key, rootElement = element,
+                                       nsmap = nsmap)
+
+        return element
+
+    def __init__(self, text = None):
+        self.text = text
+
+class XID(XObject):
+
+    pass
+
+class XIDREF(XObject):
+
+    pass
+
+class Document(XObject):
+
+    nameSpaceMap = {}
+    typeMap = {}
+
+    def __init__(self):
+        self._idsNeeded = []
+        self._dynamicClassDict = {}
+        self._ids = {}
+        self.__explicitNamespaces = False
+        self.__xmlNsMap = {}
+
+    def tostring(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
+        for key, val in self.__dict__.iteritems():
+            if key[0] == '_': continue
+            if isinstance(val, XObject):
+                break
+
+        if self.__explicitNamespaces:
+            map = self.__xmlNsMap.copy()
+            del map[None]
+        else:
+            map = self.__xmlNsMap
+
+        et = val.getElementTree(key, nsmap = map)
+        xmlString = etree.tostring(et, pretty_print = prettyPrint,
+                                   encoding = 'UTF-8',
+                                   xml_declaration = xml_declaration)
+
+        return xmlString
+
+    def fromElementTree(self, xml, rootXClass = None, nameSpaceMap = {}):
+
+        def nsmap(s):
+            for short, long in self.__xmlNsMap.iteritems():
+                if self.__explicitNamespaces and short is None:
+                    continue
+
+                if s.startswith('{' + long + '}'):
+                    if short:
+                        s = short + '_' + s[len(long) + 2:]
+                    else:
+                        s = s[len(long) + 2:]
+
+            return s
+
+        def parseElement(element, parentXType = None, parentXObj = None):
+            # handle the text for this tag
+            if element.getchildren():
+                # It's a complex type, so the text is meaningless.
+                text = None
+            else:
+                text = element.text
+
+            tag = nsmap(element.tag)
+
+            if tag in self._dynamicClassDict:
+                thisXType = self._dynamicClassDict[tag]
+            else:
+                if parentXObj is None:
+                    parentXObj = self
+                    parentXType = XTypeFromXObjectType(self.__class__)
+
+                thisXType = None
+                thisPyType = None
+
+                if parentXType:
+                    thisPyType = getattr(parentXType.pythonType, tag, None)
+
+                if not thisPyType:
+                    thisPyType = self.typeMap.get(tag, None)
+
+                if thisPyType:
+                    thisXType = XTypeFromXObjectType(thisPyType)
+
+                self._dynamicClassDict[tag] = thisXType
+
+            if thisXType:
+                if text is not None and thisXType._isComplex():
+                    # This type has child elements, so it's complex, so
+                    # the text is meaningless.
+                    text = None
+
+                xobj = thisXType.pythonType(text)
+            else:
+                localTag = nsmap(element.tag)
+                # create a subclass for this type
+                if text is None:
+                    NewClass = type(localTag + '_XObj_Type', (XObject,), {})
+                else:
+                    NewClass = type(localTag + '_XObj_Type', (XObjectStr,), {})
+                xobj = NewClass(text)
+                self._dynamicClassDict[tag] = XType(NewClass)
+
+            # handle children
+            for childElement in element.getchildren():
+                if types.BuiltinFunctionType == type(childElement.tag):
+                    # this catches comments. this is ugly.
+                    continue
+                child = parseElement(childElement, parentXType = thisXType,
+                                     parentXObj = xobj)
+
+            # handle attributes
+            for (key, val) in element.items():
+                key = nsmap(key)
+                xobj._setAttribute(self, key, val)
+
+            # anything which is the same as in the class wasn't set in XML, so
+            # set it to None
+            for key, val in xobj.__class__.__dict__.items():
+                if key[0] == '_': continue
+                if getattr(xobj, key) == val:
+                    if type(val) == list:
+                        setattr(xobj, key, [])
+                    else:
+                        setattr(xobj, key, None)
+
+            if parentXObj is not None:
+                parentXObj._addElement(tag, xobj, thisXType)
+
+            return xobj
+
+        rootElement = xml.getroot()
+
+        if not self.nameSpaceMap:
+            self.__xmlNsMap = rootElement.nsmap
+        else:
+            fullNsMap = dict((y,x) for (x,y) in self.nameSpaceMap.iteritems())
+            for short, long in rootElement.nsmap.iteritems():
+                if long not in fullNsMap:
+                    fullNsMap[long] = short
+
+            self.__xmlNsMap = dict((y,x) for (x,y) in fullNsMap.iteritems())
+
+        self.__explicitNamespaces = False
+        if None in self.__xmlNsMap:
+            if [ y for (x, y) in self.__xmlNsMap.iteritems()
+                    if x and y == self.__xmlNsMap[None] ]:
+                self.__explicitNamespaces = True
+
+        parseElement(rootElement)
+
+        for (xobj, tag, theId) in self._idsNeeded:
+            if theId not in self._ids:
+                raise XObjIdNotFound(theId)
+            xobj._addAttribute(tag, self._ids[theId])
+
+class XObjectInt(XObject, int):
+
+    pass
+
+class XObjectStr(XObject, str):
+
+    pass
+
+class XObjParseException(Exception):
+
+    pass
+
+class XObjIdNotFound(XObjParseException):
+
+    def __str__(self):
+        return "XML ID '%s' not found in document" % self.theId
+
+    def __init__(self, theId):
+        self.theId = theId
+
+class XObjSerializationException(Exception):
+
+    pass
+
+def parsef(f, schemaf = None, documentClass = Document, typeMap = {}):
+    if schemaf:
+        schemaObj = etree.XMLSchema(etree.parse(schemaf))
+    else:
+        schemaObj = None
+
+    if typeMap:
+        newClass = type('XObj_Dynamic_Document', (documentClass,),
+                        { 'typeMap' : typeMap})
+        document = newClass()
+    else:
+        document = documentClass()
+
+    parser = etree.XMLParser(schema = schemaObj)
+    xml = etree.parse(f, parser)
+    document.fromElementTree(xml)
+
+    return document
+
+def parse(s, schemaf = None, documentClass = Document, typeMap = {}):
+    s = StringIO(s)
+    return parsef(s, schemaf, documentClass = documentClass, typeMap = typeMap)
+
+
diff -r 7935b2396d1a -r adf52f88ca45 test/Makefile
--- a/test/Makefile	Tue Dec 16 19:48:00 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#
-# Copyright (C) 2004-2006 rPath, Inc.
-# All rights reserved
-#
-
-SUBDIRS=
-
-.PHONY: clean test debug-test
-
-dist_files = *.py Makefile archive/*
-
-all:
-	for dir in `find . -type d -name '*test' | fgrep -v .hg`; do \
-relativelink=`echo "$$dir" | sed s,/[^/]*,/..,g | sed 's,./,,'`; \
-ln -fs $${relativelink}/testsetup.py $$dir; \
-done
-
-install:
-	echo "nothing to install"
-
-test:
-	python2.4 testsuite.py
-
-debug-test:
-	python2.4 testsuite.py --debug
-
-clean: clean-coverage
-	@find . \( -name \*~ -o -name \*.pyc \) -exec rm -fv {} \;
-	for dir in `find . -type d -name '*test'`; do \
-            rm -f $${dir}/testsetup.py*;\
-        done
-
-clean-coverage:
-	@find . \( -name \*,cover \) -exec rm -fv {} \;
-	@rm -rf .coverage
-
diff -r 7935b2396d1a -r adf52f88ca45 test/bootstrap.py
--- a/test/bootstrap.py	Tue Dec 16 19:48:00 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#
-# Copyright (c) 2008 rPath, Inc.
-#
-# This program is distributed under the terms of the MIT License as found 
-# in a file called LICENSE. If it is not present, the license
-# is always available at http://www.opensource.org/licenses/mit-license.php.
-#
-# This program is distributed in the hope that it will be useful, but
-# without any waranty; without even the implied warranty of merchantability
-# or fitness for a particular purpose. See the MIT License for full details.
-
-import os
-import sys
-
-testUtilDir = os.environ.get('TESTUTILS_PATH', '../testutils')
-if os.path.exists(testUtilDir):
-    sys.path.insert(0, testUtilDir)
-
-try:
-    import testrunner
-except ImportError:
-    raise RuntimeError('Could not find testrunner - set TESTUTILS_PATH')
diff -r 7935b2396d1a -r adf52f88ca45 test/testsuite.py
--- a/test/testsuite.py	Tue Dec 16 19:48:00 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (c) 2008 rPath, Inc.
-#
-# This program is distributed under the terms of the MIT License as found 
-# in a file called LICENSE. If it is not present, the license
-# is always available at http://www.opensource.org/licenses/mit-license.php.
-#
-# This program is distributed in the hope that it will be useful, but
-# without any waranty; without even the implied warranty of merchantability
-# or fitness for a particular purpose. See the MIT License for full details.
-#
-import os
-import sys
-import unittest
-
-import bootstrap
-from testrunner import testhelp
-from testrunner import resources, testhandler
-
-#from pychecker import checker
-
-_setupPath = None
-
-def setup():
-    """
-    Setup initializes variables must be initialized before the testsuite
-    can be run.  Generally this means setting up and determining paths.
-    """
-    global _setupPath
-    if _setupPath:
-        return _setupPath
-
-    xobjPath = testhelp.getPath('XOBJ_PATH')
-    os.environ['XOBJ_PATH'] = xobjPath
-    for path in xobjPath.split(':'):
-        if not os.path.isdir(path):
-            print 'XOBJ_PATH %s does not exist' %path
-            sys.exit(1)
-    testhelp.insertPath(testhelp.getPath('XOBJ_PATH'), updatePythonPath=True)
-
-    from testrunner import testSetup
-    testSetup.setup()
-
-    from conary.lib import util
-    sys.excepthook = util.genExcepthook(True, catchSIGUSR1=False)
-
-    testhelp._conaryDir = resources.conaryDir
-    _setupPath = path
-    return path
-
-def main(argv=None, individual=True):
-    cfg = resources.cfg
-    cfg.isIndividual = individual
-
-    setup()
-
-    cfg.cleanTestDirs = not individual
-    cfg.coverageExclusions = ['scripts/.*', 'epdb.py', 'stackutil.py',
-                              'test/.*']
-    cfg.coverageDirs = [ os.environ['XOBJ_PATH'] ]
-
-    if argv is None:
-        argv = list(sys.argv)
-    topdir = testhelp.getTestPath()
-    if topdir not in sys.path:
-        sys.path.insert(0, topdir)
-    cwd = os.getcwd()
-    if cwd != topdir and cwd not in sys.path:
-        sys.path.insert(0, cwd)
-
-
-
-    from conary.lib import util
-    from conary.lib import coveragehook
-    sys.excepthook = util.genExcepthook(True, catchSIGUSR1=False)
-
-    handler = testhandler.TestSuiteHandler(cfg, resources)
-    print "This process PID:", os.getpid()
-    results = handler.main(argv)
-    if results is None:
-        sys.exit(0)
-    sys.exit(not results.wasSuccessful())
-
-if __name__ == '__main__':
-    #testDir = os.path.dirname(__file__)
-    #if not os.path.exists(testDir + '/conarytest/testsetup.py'):
-    #    print "Executing makefile to create required symlinks..."
-    #    os.system('make')
-    main(sys.argv, individual=False)
diff -r 7935b2396d1a -r adf52f88ca45 test/xobjtest.py
--- a/test/xobjtest.py	Tue Dec 16 19:48:00 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,316 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (c) 2008 rPath, Inc.
-#
-# This program is distributed under the terms of the MIT License as found 
-# in a file called LICENSE. If it is not present, the license
-# is always available at http://www.opensource.org/licenses/mit-license.php.
-#
-# This program is distributed in the hope that it will be useful, but
-# without any waranty; without even the implied warranty of merchantability
-# or fitness for a particular purpose. See the MIT License for full details.
-#
-
-import types
-
-import testsuite
-testsuite.setup()
-from testrunner import testhelp
-from lxml import etree
-
-from xobj import xobj
-from StringIO import StringIO
-
-class XobjTest(testhelp.TestCase):
-
-    def testSimpleParse(self):
-        xml = StringIO('<top attr1="anattr" attr2="another">\n'
-                       '    <!-- comment -->'
-                       '    <prop>something</prop>\n'
-                       '    <subelement subattr="2"/>\n'
-                       '</top>\n')
-        o = xobj.parsef(xml)
-        self.assertEqual(o.top.__class__.__name__, 'top_XObj_Type')
-        self.assertEqual(o.top.attr1, 'anattr')
-        self.assertEqual(o.top.attr2, 'another')
-        self.assertEqual(o.top.prop, 'something')
-        self.assertEqual(o.top.subelement.subattr, '2')
-        self.assertEqual(o.top.subelement.__class__.__name__,
-                         'subelement_XObj_Type')
-
-        # ---
-
-        class SubelementClass(xobj.XObject):
-            subattr = int
-
-        class TopClass(xobj.XObject):
-            subelement = SubelementClass
-            unused = str
-            attr1 = str
-
-        class DocumentClass(xobj.Document):
-            top = TopClass
-
-        o = xobj.parsef(xml, documentClass = DocumentClass)
-        self.assertEqual(o.top.subelement.subattr, 2)
-        self.assertEqual(o.top.unused, None)
-
-        # ---
-
-        class SubelementClass(xobj.XObject):
-            subattr = [ int ]
-        TopClass.subelement = SubelementClass
-
-        o = xobj.parsef(xml, documentClass = DocumentClass)
-        self.assertEqual(o.top.subelement.subattr, [ 2 ] )
-
-        # ---
-
-        TopClass.subelement = [ SubelementClass ]
-        o = xobj.parsef(xml, documentClass = DocumentClass)
-        self.assertEqual(o.top.subelement[0].subattr, [ 2] )
-
-    def testComplexParse(self):
-        xmlText = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
-                   '<top>\n'
-                   '  <prop>\n'
-                   '    <subprop subattr="1">asdf</subprop>\n'
-                   '    <subprop subattr="2">fdsa</subprop>\n'
-                   '  </prop>\n'
-                   '  <simple>simple</simple>\n'
-                   '</top>\n')
-        xml = StringIO(xmlText)
-        o = xobj.parsef(xml)
-
-        # ---
-
-        self.assertEqual(o.tostring(), xmlText)
-
-        # ---
-
-        self.assertEqual(o.top.__class__.__name__, 'top_XObj_Type')
-        self.assertEqual(type(o.top.prop.subprop), types.ListType)
-        self.assertEqual(o.top.prop.subprop, ['asdf', 'fdsa'])
-        asdf = o.top.prop.subprop[0]
-        self.assertEqual(asdf.__class__.__name__, 'subprop_XObj_Type')
-        self.assertEqual(o.top.prop.__class__.__name__,
-                         'prop_XObj_Type')
-        for i in range(2):
-            self.assertEqual(o.top.prop.subprop[i].__class__.__name__,
-                             'subprop_XObj_Type')
-        assert(o.top.prop.subprop[0].__class__ ==
-               o.top.prop.subprop[1].__class__)
-
-        # ---
-
-        class SubpropClass(xobj.XObject):
-            subattr = int
-            unused = str
-
-        class PropClass(xobj.XObject):
-            subprop = [ SubpropClass ]
-
-        class SimpleClass(xobj.XObject):
-            pass
-
-        class TopClass(xobj.XObject):
-            unused = str
-            prop = PropClass
-            simple = [ SimpleClass ]
-
-        class DocumentClass(xobj.Document):
-            top = TopClass
-
-        o = xobj.parsef(xml, documentClass = DocumentClass)
-        self.assertEqual(o.top.prop.subprop[1].subattr, 2)
-        self.assertEqual(o.top.unused, None)
-        self.assertEqual(o.top.prop.subprop[0].unused, None)
-        self.assertEqual(o.top.simple[0].text, 'simple')
-
-        # ---
-
-        # asdf/fdsa have been dropped becuase text is dropped from
-        # the complex class PropClass
-        xmlOutText = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
-                   '<top>\n'
-                   '  <prop>\n'
-                   '    <subprop subattr="1"/>\n'
-                   '    <subprop subattr="2"/>\n'
-                   '  </prop>\n'
-                   '  <simple>simple</simple>\n'
-                   '</top>\n')
-        self.assertEqual(o.tostring(), xmlOutText)
-
-
-    def testNamespaces(self):
-        xmlString = ('<top xmlns="http://this" xmlns:other="http://other/other"'
-                        ' xmlns:other2="http://other/other2">\n'
-                     '  <local/>\n'
-                     '  <other:tag other:val="1"/>\n'
-                     '  <other2:tag val="2"/>\n'
-                     '</top>\n')
-        xml = StringIO(xmlString)
-        o = xobj.parsef(xml)
-        assert(o.top.other_tag.other_val == '1')
-        assert(o.top.other2_tag.val == '2')
-        assert(o.tostring(xml_declaration = False) == xmlString)
-
-        class Top(xobj.Document):
-            nameSpaceMap = { 'other3' : 'http://other/other2' }
-
-        o = xobj.parsef(xml, documentClass = Top)
-        assert(o.top.other_tag.other_val == '1')
-        assert(o.top.other3_tag.val == '2')
-        newXmlString = xmlString.replace("other2:", "other3:")
-        newXmlString = newXmlString.replace(":other2", ":other3")
-        assert(o.tostring(xml_declaration = False) == newXmlString)
-
-    def testSchemaValidation(self):
-        s = (
-            '<?xml version="1.0" encoding="UTF-8"?>\n'
-            '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">\n'
-            '   <xs:element name="top">\n'
-            '    <xs:complexType>\n'
-            '      <xs:sequence>\n'
-            '        <xs:element name="prop" type="xs:string"/>\n'
-            '        <xs:element name="subelement">\n'
-            '          <xs:complexType>\n'
-            '          <xs:attribute name="subattr" type="xs:integer"/>\n'
-            '          </xs:complexType>\n'
-            '        </xs:element>\n'
-            '      </xs:sequence>\n'
-            '      <xs:attribute name="attr" type="xs:string"/>\n'
-            '    </xs:complexType>\n'
-            '  </xs:element>\n'
-            '</xs:schema>\n')
-        schema = StringIO(s)
-
-        s = (
-            '<top attr="anattr">\n'
-            '  <prop>something</prop>\n'
-            '  <subelement subattr="2"/>\n'
-            '</top>\n')
-        xml = StringIO(s)
-        xobj.parsef(xml, schemaf = schema)
-
-        xml = StringIO(s.replace('prop', 'prop2'))
-        xobj.parsef(xml)
-        self.assertRaises(etree.XMLSyntaxError,
-                          xobj.parsef, xml, schemaf = schema)
-
-    def testId(self):
-        s = (
-            '<top>\n'
-            '  <item id="theid" val="value"/>\n'
-            '  <ref other="theid"/>\n'
-            '</top>\n')
-        xml = StringIO(s)
-
-        class Ref(xobj.XObject):
-            other = xobj.XIDREF
-
-        class Top(xobj.XObject):
-            ref = Ref
-
-        class Document(xobj.Document):
-            top = Top
-
-        d = xobj.parsef(xml, documentClass = Document)
-        assert(d.top.ref.other == d.top.item)
-        s2 = d.tostring(xml_declaration = False)
-        self.assertEquals(s, s2)
-
-        # now test if the id is called something else
-        s = (
-            '<top>\n'
-            '  <item anid="theid" val="value"/>\n'
-            '  <ref other="theid"/>\n'
-            '</top>\n')
-        xml = StringIO(s)
-        try:
-            xobj.parsef(xml, documentClass = Document)
-        except xobj.XObjIdNotFound, e:
-            self.assertEquals(str(e), "XML ID 'theid' not found in document")
-        else:
-            assert(0)
-
-        class Item(xobj.XObject):
-            anid = xobj.XID
-        Top.item = Item
-
-        d = xobj.parsef(xml, documentClass = Document)
-        assert(d.top.ref.other == d.top.item)
-        s2 = d.tostring(xml_declaration = False)
-        self.assertEquals(s, s2)
-
-        # and test if the id isn't defined properly
-        class Top(xobj.XObject):
-            _attributes = set(['ref'])
-            ref = xobj.XIDREF
-        Document.top = Top
-
-        d = Document()
-        d.top = Top()
-        d.top.ref = xobj.XObjectStr('something')
-        try:
-            d.tostring()
-        except xobj.XObjSerializationException, e:
-            self.assertEquals(str(e), 'No id found for element referenced by ref')
-        else:
-            assert(0)
-
-    def testExplicitNamespaces(self):
-        s = (
-            '<top xmlns="http://somens.xsd" xmlns:ns="http://somens.xsd">\n'
-            '  <element ns:attr="foo"/>\n'
-            '</top>\n'
-            )
-        xml = StringIO(s)
-
-        d = xobj.parsef(xml)
-        assert(d.ns_top.ns_element.ns_attr == 'foo')
-        assert(d.__class__ == xobj.Document)
-        s2 = d.tostring(xml_declaration = False)
-
-        expecteds2 = (
-            '<ns:top xmlns:ns="http://somens.xsd">\n'
-            '  <ns:element ns:attr="foo"/>\n'
-            '</ns:top>\n'
-            )
-        assert(s2 == expecteds2)
-
-    def testUnknownType(self):
-        s ='<top/>'
-        xml = StringIO(s)
-
-        class Document(xobj.Document):
-            top = object
-
-        self.assertRaises(xobj.UnknownXType, xobj.parsef, xml,
-                          documentClass = Document)
-
-    def testTypeMap(self):
-        s ='<top><item val="3"/></top>'
-        xml = StringIO(s)
-
-        class D(xobj.Document):
-            typeMap = { 'val' : int }
-
-        d = xobj.parsef(xml, documentClass = D)
-        assert(d.top.item.val == 3)
-
-        class I(xobj.XObject):
-            val = int
-
-        d = xobj.parsef(xml, typeMap = { 'item' : I} )
-        assert(d.top.item.val == 3)
-
-    def testEmptyList(self):
-        class Top(xobj.XObject):
-            l = []
-
-        d = xobj.parse("<top/>", typeMap = { 'top' : Top })
-        assert(d.top.l == [])
-
-if __name__ == "__main__":
-    testsuite.main()
diff -r 7935b2396d1a -r adf52f88ca45 xobj/__init__.py
--- a/xobj/__init__.py	Tue Dec 16 19:48:00 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#
-# Copyright (c) 2008 rPath, Inc.
-#
-# This program is distributed under the terms of the MIT License as found 
-# in a file called LICENSE. If it is not present, the license
-# is always available at http://www.opensource.org/licenses/mit-license.php.
-#
-# This program is distributed in the hope that it will be useful, but
-# without any waranty; without even the implied warranty of merchantability
-# or fitness for a particular purpose. See the MIT License for full details.
diff -r 7935b2396d1a -r adf52f88ca45 xobj/xmlschema.py
--- a/xobj/xmlschema.py	Tue Dec 16 19:48:00 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-#
-# Copyright (c) 2008 rPath, Inc.
-#
-# This program is distributed under the terms of the MIT License as found 
-# in a file called LICENSE. If it is not present, the license
-# is always available at http://www.opensource.org/licenses/mit-license.php.
-#
-# This program is distributed in the hope that it will be useful, but
-# without any waranty; without even the implied warranty of merchantability
-# or fitness for a particular purpose. See the MIT License for full details.
-
-def smiter(item):
-    if hasattr(item, '__iter__'):
-        return item
-    else:
-        return [ item ]
-
-class AbstractSchemaMember(object):
-
-    pass
-
-class SchemaType(AbstractSchemaMember):
-
-    @staticmethod
-    def fromString(x):
-        return x
-
-class EmptyType(SchemaType):
-
-    pass
-
-class StringType(SchemaType):
-
-    pass
-
-class IntegerType(SchemaType):
-
-    @staticmethod
-    def fromString(x):
-        return int(x)
-
-class SequenceType(AbstractSchemaMember):
-
-    def findElement(self, name):
-        for x in self.elements:
-            if x.name == name:
-                return x
-
-        return None
-
-    def __init__(self, xobjSeq):
-        self.elements = [ SchemaElement(x)
-                                for x in smiter(xobjSeq.xsd_element) ]
-
-class Attribute(AbstractSchemaMember):
-
-    def getType(self):
-        return self.xtype
-
-    def __init__(self, name, xtype):
-        self.name = name
-        self.xtype = xtype
-
-class SchemaElement(AbstractSchemaMember):
-
-    def getType(self):
-        return self.xtype
-
-    def findAttribute(self, name):
-        return self.attributes.get(name, None)
-
-    def __init__(self, xobjElement):
-
-        def findSimpleType(typeStr):
-            if typeStr == 'xs:integer':
-                return IntegerType
-            elif typeStr == 'xs:string':
-                return StringType
-
-            return None
-
-        self.name = xobjElement.name
-        self.xtype = None
-        self.attributes = {}
-        attributes = None
-
-        # is this a type?
-        if hasattr(xobjElement, 'xsd_complexType'):
-            xobjType = xobjElement.xsd_complexType
-            attributes = getattr(xobjType, 'xsd_attribute', None)
-            if hasattr(xobjType, 'xsd_sequence'):
-                self.xtype = SequenceType(xobjType.xsd_sequence)
-            else:
-                self.xtype = EmptyType()
-        elif hasattr(xobjElement, 'type'):
-            self.xtype = findSimpleType(xobjElement.type)
-        else:
-            assert(0)
-
-
-        if attributes:
-            for attr in smiter(attributes):
-                self.attributes[attr.name] = Attribute(
-                                        attr.name, findSimpleType(attr.type))
-
-
-class Schema(SequenceType):
-
-    def __init__(self, xobjSchema):
-        # xobjSchema is a schema; it's children are global
-
-        # XXX parse global types
-        # XXX parse global attributes
-        SequenceType.__init__(self, xobjSchema)
-
-
diff -r 7935b2396d1a -r adf52f88ca45 xobj/xobj.py
--- a/xobj/xobj.py	Tue Dec 16 19:48:00 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,383 +0,0 @@
-#
-# Copyright (c) 2008 rPath, Inc.
-#
-# This program is distributed under the terms of the MIT License as found 
-# in a file called LICENSE. If it is not present, the license
-# is always available at http://www.opensource.org/licenses/mit-license.php.
-#
-# This program is distributed in the hope that it will be useful, but
-# without any waranty; without even the implied warranty of merchantability
-# or fitness for a particular purpose. See the MIT License for full details.
-
-from lxml import etree
-import xmlschema
-import types
-from StringIO import StringIO
-
-class UnknownXType(Exception):
-
-    pass
-
-class XType(object):
-
-    def _isComplex(self):
-        for key in self.pythonType.__dict__.iterkeys():
-            if key[0] != '_':
-                return True
-
-        return False
-
-    def __init__(self, pythonType, forceList = False):
-        self.pythonType = pythonType
-        self.forceList = forceList
-
-def XTypeFromXObjectType(xObjectType):
-
-    if (type(xObjectType) == type and
-            issubclass(xObjectType, XObject)):
-        return XType(xObjectType)
-    elif xObjectType == int:
-        return XType(XObjectInt)
-    elif xObjectType == str:
-        return XType(str)
-    elif type(xObjectType) == list:
-        assert(len(xObjectType) == 1)
-        return XType(XTypeFromXObjectType(xObjectType[0]).pythonType,
-                     forceList = True)
-
-    raise UnknownXType
-
-class XObject(object):
-
-    _elements = []
-    _attributes = set()
-
-    def _setAttribute(self, doc, key, val):
-        expectedType = getattr(self.__class__, key, None)
-        if expectedType is None:
-            expectedType = doc.typeMap.get(key, None)
-
-        if expectedType:
-            expectedXType = XTypeFromXObjectType(expectedType)
-            if (key == 'id' or key == 'xml_id' or
-                        issubclass(expectedXType.pythonType, XID)):
-                doc._ids[val] = self
-            elif issubclass(expectedXType.pythonType, XIDREF):
-                doc._idsNeeded.append((self, key, val))
-                return
-            else:
-                val = expectedXType.pythonType(val)
-        else:
-            if (key == 'id' or key == 'xml_id'):
-                doc._ids[val] = self
-
-            expectedXType = None
-            val = XObjectStr(val)
-
-        self._addAttribute(key, val, xType = expectedXType)
-
-    def _addAttribute(self, key, val, xType = None):
-        if not self._attributes:
-            self._attributes = set([key])
-        elif key not in self._attributes:
-            self._attributes.add(key)
-
-        self._setItem(key, val, xType)
-
-    def _addElement(self, key, val, xType = None):
-        self._setItem(key, val, xType = xType)
-        if not self._elements:
-            self._elements = [ key ]
-        elif key not in self._elements:
-            self._elements.append(key)
-
-    def _setItem(self, key, val, xType = None):
-        current = getattr(self, key, None)
-        if xType and xType.forceList:
-            # force the item to be a list, and use the type inside of
-            # this list as the type of elements of the list
-            if key not in self.__dict__:
-                current = []
-                setattr(self, key, current)
-
-        if self.__dict__.get(key, None) is None:
-            # This has not yet been set in the instance (because it's missing) or it's been
-            # set to None (because we think we don't have this value but it's actually an idref
-            # being filled in later)
-            setattr(self, key, val)
-        elif type(current) == list:
-            current.append(val)
-        else:
-            setattr(self, key, [ current, val ])
-
-    def getElementTree(self, tag, rootElement = None, nsmap = {}):
-
-        def addns(s):
-            for short, long in nsmap.iteritems():
-                if short and s.startswith(short + '_'):
-                    s = '{' + long + '}' + s[len(short) + 1:]
-
-            return s
-
-        tag = addns(tag)
-
-        attrs = {}
-        elements = {}
-        for key, val in self.__dict__.iteritems():
-            if key[0] != '_':
-                if key in self._attributes:
-                    pythonType = getattr(self.__class__, key, None)
-                    if pythonType and issubclass(pythonType, XIDREF):
-                        idVal = getattr(val, 'id', None)
-                        if idVal is None:
-                            for idKey, idType in val.__class__.__dict__.iteritems():
-                                if (idKey[0] != '_' and type(idType) == type
-                                                and issubclass(idType, XID)):
-                                    idVal = getattr(val, idKey)
-
-                        if idVal is None:
-                            raise XObjSerializationException('No id found for element referenced by '
-                                                             '%s' % key)
-                        val = idVal
-
-                    key = addns(key)
-                    attrs[key] = str(val)
-                else:
-                    l = elements.setdefault(key, [])
-                    l.append(val)
-
-        orderedElements = []
-        if self._elements:
-            for name in self._elements:
-                for val in elements[name]:
-                    orderedElements.append((name, val))
-            for name in (set(elements) - set(self._elements)):
-                for val in elements[name]:
-                    orderedElements.append((name, val))
-
-        if rootElement is None:
-            element = etree.Element(tag, attrs, nsmap = nsmap)
-        else:
-            element = etree.SubElement(rootElement, tag, attrs)
-
-        if self.text is not None:
-            element.text = self.text
-
-        for key, val in orderedElements:
-            if val is not None:
-                if type(val) == list:
-                    for subval in val:
-                        subval.getElementTree(key, rootElement = element,
-                                              nsmap = nsmap)
-                else:
-                    val.getElementTree(key, rootElement = element,
-                                       nsmap = nsmap)
-
-        return element
-
-    def __init__(self, text = None):
-        self.text = text
-
-class XID(XObject):
-
-    pass
-
-class XIDREF(XObject):
-
-    pass
-
-class Document(XObject):
-
-    nameSpaceMap = {}
-    typeMap = {}
-
-    def __init__(self):
-        self._idsNeeded = []
-        self._dynamicClassDict = {}
-        self._ids = {}
-        self.__explicitNamespaces = False
-        self.__xmlNsMap = {}
-
-    def tostring(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
-        for key, val in self.__dict__.iteritems():
-            if key[0] == '_': continue
-            if isinstance(val, XObject):
-                break
-
-        if self.__explicitNamespaces:
-            map = self.__xmlNsMap.copy()
-            del map[None]
-        else:
-            map = self.__xmlNsMap
-
-        et = val.getElementTree(key, nsmap = map)
-        xmlString = etree.tostring(et, pretty_print = prettyPrint,
-                                   encoding = 'UTF-8',
-                                   xml_declaration = xml_declaration)
-
-        return xmlString
-
-    def fromElementTree(self, xml, rootXClass = None, nameSpaceMap = {}):
-
-        def nsmap(s):
-            for short, long in self.__xmlNsMap.iteritems():
-                if self.__explicitNamespaces and short is None:
-                    continue
-
-                if s.startswith('{' + long + '}'):
-                    if short:
-                        s = short + '_' + s[len(long) + 2:]
-                    else:
-                        s = s[len(long) + 2:]
-
-            return s
-
-        def parseElement(element, parentXType = None, parentXObj = None):
-            # handle the text for this tag
-            if element.getchildren():
-                # It's a complex type, so the text is meaningless.
-                text = None
-            else:
-                text = element.text
-
-            tag = nsmap(element.tag)
-
-            if tag in self._dynamicClassDict:
-                thisXType = self._dynamicClassDict[tag]
-            else:
-                if parentXObj is None:
-                    parentXObj = self
-                    parentXType = XTypeFromXObjectType(self.__class__)
-
-                thisXType = None
-                thisPyType = None
-
-                if parentXType:
-                    thisPyType = getattr(parentXType.pythonType, tag, None)
-
-                if not thisPyType:
-                    thisPyType = self.typeMap.get(tag, None)
-
-                if thisPyType:
-                    thisXType = XTypeFromXObjectType(thisPyType)
-
-                self._dynamicClassDict[tag] = thisXType
-
-            if thisXType:
-                if text is not None and thisXType._isComplex():
-                    # This type has child elements, so it's complex, so
-                    # the text is meaningless.
-                    text = None
-
-                xobj = thisXType.pythonType(text)
-            else:
-                localTag = nsmap(element.tag)
-                # create a subclass for this type
-                if text is None:
-                    NewClass = type(localTag + '_XObj_Type', (XObject,), {})
-                else:
-                    NewClass = type(localTag + '_XObj_Type', (XObjectStr,), {})
-                xobj = NewClass(text)
-                self._dynamicClassDict[tag] = XType(NewClass)
-
-            # handle children
-            for childElement in element.getchildren():
-                if types.BuiltinFunctionType == type(childElement.tag):
-                    # this catches comments. this is ugly.
-                    continue
-                child = parseElement(childElement, parentXType = thisXType,
-                                     parentXObj = xobj)
-
-            # handle attributes
-            for (key, val) in element.items():
-                key = nsmap(key)
-                xobj._setAttribute(self, key, val)
-
-            # anything which is the same as in the class wasn't set in XML, so
-            # set it to None
-            for key, val in xobj.__class__.__dict__.items():
-                if key[0] == '_': continue
-                if getattr(xobj, key) == val:
-                    if type(val) == list:
-                        setattr(xobj, key, [])
-                    else:
-                        setattr(xobj, key, None)
-
-            if parentXObj is not None:
-                parentXObj._addElement(tag, xobj, thisXType)
-
-            return xobj
-
-        rootElement = xml.getroot()
-
-        if not self.nameSpaceMap:
-            self.__xmlNsMap = rootElement.nsmap
-        else:
-            fullNsMap = dict((y,x) for (x,y) in self.nameSpaceMap.iteritems())
-            for short, long in rootElement.nsmap.iteritems():
-                if long not in fullNsMap:
-                    fullNsMap[long] = short
-
-            self.__xmlNsMap = dict((y,x) for (x,y) in fullNsMap.iteritems())
-
-        self.__explicitNamespaces = False
-        if None in self.__xmlNsMap:
-            if [ y for (x, y) in self.__xmlNsMap.iteritems()
-                    if x and y == self.__xmlNsMap[None] ]:
-                self.__explicitNamespaces = True
-
-        parseElement(rootElement)
-
-        for (xobj, tag, theId) in self._idsNeeded:
-            if theId not in self._ids:
-                raise XObjIdNotFound(theId)
-            xobj._addAttribute(tag, self._ids[theId])
-
-class XObjectInt(XObject, int):
-
-    pass
-
-class XObjectStr(XObject, str):
-
-    pass
-
-class XObjParseException(Exception):
-
-    pass
-
-class XObjIdNotFound(XObjParseException):
-
-    def __str__(self):
-        return "XML ID '%s' not found in document" % self.theId
-
-    def __init__(self, theId):
-        self.theId = theId
-
-class XObjSerializationException(Exception):
-
-    pass
-
-def parsef(f, schemaf = None, documentClass = Document, typeMap = {}):
-    if schemaf:
-        schemaObj = etree.XMLSchema(etree.parse(schemaf))
-    else:
-        schemaObj = None
-
-    if typeMap:
-        newClass = type('XObj_Dynamic_Document', (documentClass,),
-                        { 'typeMap' : typeMap})
-        document = newClass()
-    else:
-        document = documentClass()
-
-    parser = etree.XMLParser(schema = schemaObj)
-    xml = etree.parse(f, parser)
-    document.fromElementTree(xml)
-
-    return document
-
-def parse(s, schemaf = None, documentClass = Document, typeMap = {}):
-    s = StringIO(s)
-    return parsef(s, schemaf, documentClass = documentClass, typeMap = typeMap)
-
-

From ewt@rpath.com Thu Dec 18 15:49:02 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBIFn1Cl016606
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:49:01 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBIFn1Xk003675
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 10:49:01 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBIFn1hu024029
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 10:49:01 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBIFn0B5016806
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 10:49:00 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBIFn0x9016801
	for xobj-commits@lists.rpath.com; Thu, 18 Dec 2008 10:49:00 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812181549.mBIFn0x9016801@scc.eng.rpath.com>
Date: Thu, 18 Dec 2008 10:49:00 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj-py: create test xml files during run so as3 tests can use
 them
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Dec 2008 15:49:02 -0000

tag:         tip
user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py test/explicitns.xml test/id1.xml test/id2.xml test/namespaces.xml test/simple.xml

create test xml files during run so as3 tests can use them

diff -r adf52f88ca45 -r 784c40601995 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Thu Dec 18 10:37:53 2008 -0500
+++ b/py/test/xobjtest.py	Thu Dec 18 10:46:38 2008 -0500
@@ -21,14 +21,22 @@
 from xobj import xobj
 from StringIO import StringIO
 
+def _xml(fn, s, asFile = False):
+    f = open("../../test/%s.xml" % fn, "w")
+    f.write(s)
+    if asFile:
+        return StringIO(s)
+
+    return s
+
 class XobjTest(testhelp.TestCase):
 
     def testSimpleParse(self):
-        xml = StringIO('<top attr1="anattr" attr2="another">\n'
-                       '    <!-- comment -->'
-                       '    <prop>something</prop>\n'
-                       '    <subelement subattr="2"/>\n'
-                       '</top>\n')
+        xml = _xml('simple', '<top attr1="anattr" attr2="another">\n'
+                             '    <!-- comment -->'
+                             '    <prop>something</prop>\n'
+                             '    <subelement subattr="2"/>\n'
+                             '</top>\n', asFile = True)
         o = xobj.parsef(xml)
         self.assertEqual(o.top.__class__.__name__, 'top_XObj_Type')
         self.assertEqual(o.top.attr1, 'anattr')
@@ -71,14 +79,15 @@
         self.assertEqual(o.top.subelement[0].subattr, [ 2] )
 
     def testComplexParse(self):
-        xmlText = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
-                   '<top>\n'
-                   '  <prop>\n'
-                   '    <subprop subattr="1">asdf</subprop>\n'
-                   '    <subprop subattr="2">fdsa</subprop>\n'
-                   '  </prop>\n'
-                   '  <simple>simple</simple>\n'
-                   '</top>\n')
+        xmlText = _xml('complex',
+                       '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                       '<top>\n'
+                       '  <prop>\n'
+                       '    <subprop subattr="1">asdf</subprop>\n'
+                       '    <subprop subattr="2">fdsa</subprop>\n'
+                       '  </prop>\n'
+                       '  <simple>simple</simple>\n'
+                       '</top>\n')
         xml = StringIO(xmlText)
         o = xobj.parsef(xml)
 
@@ -132,23 +141,24 @@
         # asdf/fdsa have been dropped becuase text is dropped from
         # the complex class PropClass
         xmlOutText = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
-                   '<top>\n'
-                   '  <prop>\n'
-                   '    <subprop subattr="1"/>\n'
-                   '    <subprop subattr="2"/>\n'
-                   '  </prop>\n'
-                   '  <simple>simple</simple>\n'
-                   '</top>\n')
+                      '<top>\n'
+                      '  <prop>\n'
+                      '    <subprop subattr="1"/>\n'
+                      '    <subprop subattr="2"/>\n'
+                      '  </prop>\n'
+                      '  <simple>simple</simple>\n'
+                      '</top>\n')
         self.assertEqual(o.tostring(), xmlOutText)
 
 
     def testNamespaces(self):
-        xmlString = ('<top xmlns="http://this" xmlns:other="http://other/other"'
-                        ' xmlns:other2="http://other/other2">\n'
-                     '  <local/>\n'
-                     '  <other:tag other:val="1"/>\n'
-                     '  <other2:tag val="2"/>\n'
-                     '</top>\n')
+        xmlString = _xml('namespaces',
+                    '<top xmlns="http://this" xmlns:other="http://other/other"'
+                    ' xmlns:other2="http://other/other2">\n'
+                    '  <local/>\n'
+                    '  <other:tag other:val="1"/>\n'
+                    '  <other2:tag val="2"/>\n'
+                    '</top>\n')
         xml = StringIO(xmlString)
         o = xobj.parsef(xml)
         assert(o.top.other_tag.other_val == '1')
@@ -199,7 +209,7 @@
                           xobj.parsef, xml, schemaf = schema)
 
     def testId(self):
-        s = (
+        s = _xml('id1',
             '<top>\n'
             '  <item id="theid" val="value"/>\n'
             '  <ref other="theid"/>\n'
@@ -221,7 +231,7 @@
         self.assertEquals(s, s2)
 
         # now test if the id is called something else
-        s = (
+        s = _xml('id2',
             '<top>\n'
             '  <item anid="theid" val="value"/>\n'
             '  <ref other="theid"/>\n'
@@ -260,7 +270,7 @@
             assert(0)
 
     def testExplicitNamespaces(self):
-        s = (
+        s = _xml('explicitns',
             '<top xmlns="http://somens.xsd" xmlns:ns="http://somens.xsd">\n'
             '  <element ns:attr="foo"/>\n'
             '</top>\n'
diff -r adf52f88ca45 -r 784c40601995 test/explicitns.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/explicitns.xml	Thu Dec 18 10:46:38 2008 -0500
@@ -0,0 +1,3 @@
+<top xmlns="http://somens.xsd" xmlns:ns="http://somens.xsd">
+  <element ns:attr="foo"/>
+</top>
diff -r adf52f88ca45 -r 784c40601995 test/id1.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/id1.xml	Thu Dec 18 10:46:38 2008 -0500
@@ -0,0 +1,4 @@
+<top>
+  <item id="theid" val="value"/>
+  <ref other="theid"/>
+</top>
diff -r adf52f88ca45 -r 784c40601995 test/id2.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/id2.xml	Thu Dec 18 10:46:38 2008 -0500
@@ -0,0 +1,4 @@
+<top>
+  <item anid="theid" val="value"/>
+  <ref other="theid"/>
+</top>
diff -r adf52f88ca45 -r 784c40601995 test/namespaces.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/namespaces.xml	Thu Dec 18 10:46:38 2008 -0500
@@ -0,0 +1,5 @@
+<top xmlns="http://this" xmlns:other="http://other/other" xmlns:other2="http://other/other2">
+  <local/>
+  <other:tag other:val="1"/>
+  <other2:tag val="2"/>
+</top>
diff -r adf52f88ca45 -r 784c40601995 test/simple.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/simple.xml	Thu Dec 18 10:46:38 2008 -0500
@@ -0,0 +1,4 @@
+<top attr1="anattr" attr2="another">
+    <!-- comment -->    <prop>something</prop>
+    <subelement subattr="2"/>
+</top>

From johnsonm@rpath.com Thu Dec 18 16:36:12 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBIGaCtb017531
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 16:36:12 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBIGaCqL011107
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 11:36:12 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBIGaCTh028047
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 11:36:12 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBIGaBBh018640
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 11:36:11 -0500
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBIGaBHL018635
	for xobj-commits@lists.rpath.com; Thu, 18 Dec 2008 11:36:11 -0500
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200812181636.mBIGaBHL018635@scc.eng.rpath.com>
Date: Thu, 18 Dec 2008 11:36:11 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Add README file
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Dec 2008 16:36:12 -0000

tag:         tip
user:        Michael K. Johnson <http://issues.rpath.com/>
files:       README

Add README file

diff -r 784c40601995 -r 95665f7b3228 README
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README	Thu Dec 18 11:36:08 2008 -0500
@@ -0,0 +1,28 @@
+INTRODUCTION
+============
+
+The xobj project provides an object reflector between various
+dynamic languages and XML.  Currently, Python and ActionScript 3
+implementations are available.
+
+These interfaces are intended to allow for concise code for using
+and manipulating XML documents.  For example, using the ElementTree
+Python library, you might write something like this:
+
+    imageItem = [ x for x in parent if x.tag='image' ]
+
+In this case, imageItem will always be a list, even if it is
+not defined in the XML schema to be a sequence.
+
+Using xobj, you could refer to the image element more directly:
+
+    parent.image
+
+That will be either a single item or a list, depending on the
+context.
+
+It is not required to provide an XML schema to use xobj.  Custom
+objects may be used for parts or all of the document, whether or
+not an XML schema is provided.  Schema validation is optional.
+If new elements show up, they will be preserved across read/write;
+schema additions will not normally require code changes.

From ewt@rpath.com Thu Dec 18 17:05:03 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBIH53T5018077
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 17:05:03 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBIH53hj014211
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 12:05:03 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBIH52Yo029946
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 12:05:02 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBIH52w2020466
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 12:05:02 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBIH51aB020461
	for xobj-commits@lists.rpath.com; Thu, 18 Dec 2008 12:05:01 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812181705.mBIH51aB020461@scc.eng.rpath.com>
Date: Thu, 18 Dec 2008 12:05:01 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: added support for lists of unions
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Dec 2008 17:05:03 -0000

tag:         tip
user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

added support for lists of unions

diff -r 95665f7b3228 -r 54ea68659862 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Thu Dec 18 11:36:08 2008 -0500
+++ b/py/test/xobjtest.py	Thu Dec 18 12:04:54 2008 -0500
@@ -317,10 +317,41 @@
 
     def testEmptyList(self):
         class Top(xobj.XObject):
-            l = []
+            l = [ int ]
 
         d = xobj.parse("<top/>", typeMap = { 'top' : Top })
         assert(d.top.l == [])
 
+    def testUnion(self):
+        class TypeA(xobj.XObject):
+            vala = int
+
+        class TypeB(xobj.XObject):
+            valb = int
+
+        class Top(xobj.XObject):
+            items = [ { 'typea' : TypeA,
+                        'typeb' : TypeB } ]
+
+        s = _xml('union',
+                 '<top>\n'
+                 '  <typea vala="1"/>\n'
+                 '  <typeb valb="2"/>\n'
+                 '  <typea vala="3"/>\n'
+                 '  <typeb valb="4"/>\n'
+                 '  <typea vala="5"/>\n'
+                 '</top>\n')
+
+        d = xobj.parse(s, typeMap = { 'top' : Top } )
+        assert(d.top.items[0].vala == 1)
+        assert(d.top.items[1].valb == 2)
+        assert(d.top.items[2].vala == 3)
+        assert(d.top.items[3].valb == 4)
+        assert(d.top.items[4].vala == 5)
+        assert(s == d.tostring(xml_declaration = False))
+
+        d = xobj.parse('<top/>', typeMap = { 'top' : Top } )
+        assert(d.top.items == [])
+
 if __name__ == "__main__":
     testsuite.main()
diff -r 95665f7b3228 -r 54ea68659862 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Thu Dec 18 11:36:08 2008 -0500
+++ b/py/xobj/xobj.py	Thu Dec 18 12:04:54 2008 -0500
@@ -30,6 +30,14 @@
     def __init__(self, pythonType, forceList = False):
         self.pythonType = pythonType
         self.forceList = forceList
+
+class XUnionType(XType):
+
+    def __init__(self, d):
+        self.d = {}
+        for key, val in d.iteritems():
+            self.d[key] = XTypeFromXObjectType(val)
+            self.d[key].forceList = True
 
 def XTypeFromXObjectType(xObjectType):
 
@@ -119,7 +127,10 @@
 
             return s
 
-        tag = addns(tag)
+        if hasattr(self, '_tag'):
+            tag = self._tag
+        else:
+            tag = addns(tag)
 
         attrs = {}
         elements = {}
@@ -217,7 +228,8 @@
 
         return xmlString
 
-    def fromElementTree(self, xml, rootXClass = None, nameSpaceMap = {}):
+    def fromElementTree(self, xml, rootXClass = None, nameSpaceMap = {},
+                        unionTags = {}):
 
         def nsmap(s):
             for short, long in self.__xmlNsMap.iteritems():
@@ -232,7 +244,8 @@
 
             return s
 
-        def parseElement(element, parentXType = None, parentXObj = None):
+        def parseElement(element, parentXType = None, parentXObj = None,
+                         parentUnionTags = {}):
             # handle the text for this tag
             if element.getchildren():
                 # It's a complex type, so the text is meaningless.
@@ -253,7 +266,10 @@
                 thisPyType = None
 
                 if parentXType:
-                    thisPyType = getattr(parentXType.pythonType, tag, None)
+                    if tag in parentUnionTags:
+                        thisPyType = parentUnionTags[tag][1].pythonType
+                    else:
+                        thisPyType = getattr(parentXType.pythonType, tag, None)
 
                 if not thisPyType:
                     thisPyType = self.typeMap.get(tag, None)
@@ -263,6 +279,7 @@
 
                 self._dynamicClassDict[tag] = thisXType
 
+            unionTags = {}
             if thisXType:
                 if text is not None and thisXType._isComplex():
                     # This type has child elements, so it's complex, so
@@ -270,6 +287,13 @@
                     text = None
 
                 xobj = thisXType.pythonType(text)
+
+                # look for unions
+                for key, val in thisXType.pythonType.__dict__.iteritems():
+                    if isinstance(val, list) and isinstance(val[0], dict):
+                        ut = XUnionType(val[0])
+                        for a, b in ut.d.iteritems():
+                            unionTags[a] = (key, b)
             else:
                 localTag = nsmap(element.tag)
                 # create a subclass for this type
@@ -286,7 +310,8 @@
                     # this catches comments. this is ugly.
                     continue
                 child = parseElement(childElement, parentXType = thisXType,
-                                     parentXObj = xobj)
+                                     parentXObj = xobj,
+                                     parentUnionTags = unionTags)
 
             # handle attributes
             for (key, val) in element.items():
@@ -304,7 +329,12 @@
                         setattr(xobj, key, None)
 
             if parentXObj is not None:
-                parentXObj._addElement(tag, xobj, thisXType)
+                if tag in parentUnionTags:
+                    xobj._tag = tag
+                    parentXObj._addElement(parentUnionTags[tag][0], xobj,
+                                           parentUnionTags[tag][1])
+                else:
+                    parentXObj._addElement(tag, xobj, thisXType)
 
             return xobj
 

From ewt@rpath.com Thu Dec 18 20:22:22 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBIKMMCU021624
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 20:22:22 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBIKMLMD004277
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:22:21 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBIKMLPb010638
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:22:21 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBIKMKbG027412
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:22:20 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBIKMKAw027398
	for xobj-commits@lists.rpath.com; Thu, 18 Dec 2008 15:22:20 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812182022.mBIKMKAw027398@scc.eng.rpath.com>
Date: Thu, 18 Dec 2008 15:22:20 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: remove unused xmlschema.py
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Dec 2008 20:22:22 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       py/xobj/xmlschema.py

remove unused xmlschema.py

diff -r 54ea68659862 -r 2fae242563b9 py/xobj/xmlschema.py
--- a/py/xobj/xmlschema.py	Thu Dec 18 12:04:54 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-#
-# Copyright (c) 2008 rPath, Inc.
-#
-# This program is distributed under the terms of the MIT License as found 
-# in a file called LICENSE. If it is not present, the license
-# is always available at http://www.opensource.org/licenses/mit-license.php.
-#
-# This program is distributed in the hope that it will be useful, but
-# without any waranty; without even the implied warranty of merchantability
-# or fitness for a particular purpose. See the MIT License for full details.
-
-def smiter(item):
-    if hasattr(item, '__iter__'):
-        return item
-    else:
-        return [ item ]
-
-class AbstractSchemaMember(object):
-
-    pass
-
-class SchemaType(AbstractSchemaMember):
-
-    @staticmethod
-    def fromString(x):
-        return x
-
-class EmptyType(SchemaType):
-
-    pass
-
-class StringType(SchemaType):
-
-    pass
-
-class IntegerType(SchemaType):
-
-    @staticmethod
-    def fromString(x):
-        return int(x)
-
-class SequenceType(AbstractSchemaMember):
-
-    def findElement(self, name):
-        for x in self.elements:
-            if x.name == name:
-                return x
-
-        return None
-
-    def __init__(self, xobjSeq):
-        self.elements = [ SchemaElement(x)
-                                for x in smiter(xobjSeq.xsd_element) ]
-
-class Attribute(AbstractSchemaMember):
-
-    def getType(self):
-        return self.xtype
-
-    def __init__(self, name, xtype):
-        self.name = name
-        self.xtype = xtype
-
-class SchemaElement(AbstractSchemaMember):
-
-    def getType(self):
-        return self.xtype
-
-    def findAttribute(self, name):
-        return self.attributes.get(name, None)
-
-    def __init__(self, xobjElement):
-
-        def findSimpleType(typeStr):
-            if typeStr == 'xs:integer':
-                return IntegerType
-            elif typeStr == 'xs:string':
-                return StringType
-
-            return None
-
-        self.name = xobjElement.name
-        self.xtype = None
-        self.attributes = {}
-        attributes = None
-
-        # is this a type?
-        if hasattr(xobjElement, 'xsd_complexType'):
-            xobjType = xobjElement.xsd_complexType
-            attributes = getattr(xobjType, 'xsd_attribute', None)
-            if hasattr(xobjType, 'xsd_sequence'):
-                self.xtype = SequenceType(xobjType.xsd_sequence)
-            else:
-                self.xtype = EmptyType()
-        elif hasattr(xobjElement, 'type'):
-            self.xtype = findSimpleType(xobjElement.type)
-        else:
-            assert(0)
-
-
-        if attributes:
-            for attr in smiter(attributes):
-                self.attributes[attr.name] = Attribute(
-                                        attr.name, findSimpleType(attr.type))
-
-
-class Schema(SequenceType):
-
-    def __init__(self, xobjSchema):
-        # xobjSchema is a schema; it's children are global
-
-        # XXX parse global types
-        # XXX parse global attributes
-        SequenceType.__init__(self, xobjSchema)
-
-

From ewt@rpath.com Thu Dec 18 20:22:23 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBIKMNSB021627
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 20:22:23 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBIKMNba004286
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:22:23 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBIKMMk3010642
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:22:22 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBIKMMsZ027455
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:22:22 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBIKMMBp027438
	for xobj-commits@lists.rpath.com; Thu, 18 Dec 2008 15:22:22 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812182022.mBIKMMBp027438@scc.eng.rpath.com>
Date: Thu, 18 Dec 2008 15:22:21 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: added some docs, removed xmlschema,
	cleaned up some corners with str and
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Dec 2008 20:22:24 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

added some docs, removed xmlschema, cleaned up some corners with str and
int types

diff -r 2fae242563b9 -r c8cd900d5239 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Thu Dec 18 13:10:58 2008 -0500
+++ b/py/test/xobjtest.py	Thu Dec 18 13:54:08 2008 -0500
@@ -68,15 +68,19 @@
         class SubelementClass(xobj.XObject):
             subattr = [ int ]
         TopClass.subelement = SubelementClass
+        TopClass.prop = xobj.XObject
 
         o = xobj.parsef(xml, documentClass = DocumentClass)
         self.assertEqual(o.top.subelement.subattr, [ 2 ] )
+        self.assertEqual(o.top.prop.text, 'something')
 
         # ---
 
         TopClass.subelement = [ SubelementClass ]
+        TopClass.prop = [ str ]
         o = xobj.parsef(xml, documentClass = DocumentClass)
         self.assertEqual(o.top.subelement[0].subattr, [ 2] )
+        self.assertEqual(o.top.prop, [ 'something' ])
 
     def testComplexParse(self):
         xmlText = _xml('complex',
diff -r 2fae242563b9 -r c8cd900d5239 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Thu Dec 18 13:10:58 2008 -0500
+++ b/py/xobj/xobj.py	Thu Dec 18 13:54:08 2008 -0500
@@ -10,19 +10,23 @@
 # or fitness for a particular purpose. See the MIT License for full details.
 
 from lxml import etree
-import xmlschema
 import types
 from StringIO import StringIO
 
 class UnknownXType(Exception):
 
-    pass
+    """
+    Exception raised when a class prototype specifies a type which is not
+    understood.
+    """
 
 class XType(object):
 
     def _isComplex(self):
-        for key in self.pythonType.__dict__.iterkeys():
-            if key[0] != '_':
+        for key, val in self.pythonType.__dict__.iteritems():
+            if (type(val) != types.FunctionType and 
+                 type(val) != types.MethodType and key[0] != '_'
+                 and key != 'text'):
                 return True
 
         return False
@@ -47,7 +51,7 @@
     elif xObjectType == int:
         return XType(XObjectInt)
     elif xObjectType == str:
-        return XType(str)
+        return XType(XObjectStr)
     elif type(xObjectType) == list:
         assert(len(xObjectType) == 1)
         return XType(XTypeFromXObjectType(xObjectType[0]).pythonType,
@@ -57,8 +61,38 @@
 
 class XObject(object):
 
+    """
+    Superclass for all elements represented in XML. Subclasses of XObject
+    can be used to specify how attributes and elements of the element are
+    represented in python. For example, parsing the XML:
+
+        <element intAttr="10" strAttr="hello">
+           <subelement>Value</subelement>
+        </element>
+
+    using this class:
+
+        class Element(xobj.XObject):
+
+            intAttr = int
+            strAttr = str
+            subelement = [ xobj.XObject ]
+
+    (which is done with doc = xobj.parse("---xml string---",
+                                    typeMap = { 'element' : Element } )
+    will result in the object tree:
+
+        doc.element.intAttr = 10
+        doc.element.strAttr = 'hello'
+        doc.element.subelement.text = [ 'Value' ]
+
+    """
+
     _elements = []
     _attributes = set()
+
+    def __init__(self, text = None):
+        assert(text is None)
 
     def _setAttribute(self, doc, key, val):
         expectedType = getattr(self.__class__, key, None)
@@ -186,9 +220,6 @@
 
         return element
 
-    def __init__(self, text = None):
-        self.text = text
-
 class XID(XObject):
 
     pass
@@ -253,6 +284,9 @@
             else:
                 text = element.text
 
+            if element.tag == 'prop':
+                import epdb;epdb.st('f')
+
             tag = nsmap(element.tag)
 
             if tag in self._dynamicClassDict:
@@ -290,6 +324,7 @@
 
                 # look for unions
                 for key, val in thisXType.pythonType.__dict__.iteritems():
+                    if key[0] == '_': continue
                     if isinstance(val, list) and isinstance(val[0], dict):
                         ut = XUnionType(val[0])
                         for a, b in ut.d.iteritems():
@@ -365,11 +400,13 @@
 
 class XObjectInt(XObject, int):
 
-    pass
+    def __init__(self, v):
+        XObject.__init__(self, None)
 
 class XObjectStr(XObject, str):
 
-    pass
+    def __init__(self, v):
+        XObject.__init__(self)
 
 class XObjParseException(Exception):
 

From ewt@rpath.com Thu Dec 18 20:22:24 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBIKMOYd021633
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 20:22:24 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBIKMO4e004293
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:22:24 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBIKMOfI010645
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:22:24 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBIKMNG2027485
	for <xobj-commits@lists.rpath.com>; Thu, 18 Dec 2008 15:22:23 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBIKMNEU027479
	for xobj-commits@lists.rpath.com; Thu, 18 Dec 2008 15:22:23 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812182022.mBIKMNEU027479@scc.eng.rpath.com>
Date: Thu, 18 Dec 2008 15:22:23 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: make XObject the same as XObjectStr, and make __repr__
	smart enough to keep
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Dec 2008 20:22:24 -0000

tag:         tip
user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

make XObject the same as XObjectStr, and make __repr__ smart enough to keep
that from being gross

diff -r c8cd900d5239 -r 88ba4997b14a py/test/xobjtest.py
--- a/py/test/xobjtest.py	Thu Dec 18 13:54:08 2008 -0500
+++ b/py/test/xobjtest.py	Thu Dec 18 15:22:16 2008 -0500
@@ -72,7 +72,7 @@
 
         o = xobj.parsef(xml, documentClass = DocumentClass)
         self.assertEqual(o.top.subelement.subattr, [ 2 ] )
-        self.assertEqual(o.top.prop.text, 'something')
+        self.assertEqual(o.top.prop, 'something')
 
         # ---
 
@@ -138,7 +138,7 @@
         self.assertEqual(o.top.prop.subprop[1].subattr, 2)
         self.assertEqual(o.top.unused, None)
         self.assertEqual(o.top.prop.subprop[0].unused, None)
-        self.assertEqual(o.top.simple[0].text, 'simple')
+        self.assertEqual(o.top.simple[0], 'simple')
 
         # ---
 
@@ -265,7 +265,7 @@
 
         d = Document()
         d.top = Top()
-        d.top.ref = xobj.XObjectStr('something')
+        d.top.ref = xobj.XObject('something')
         try:
             d.tostring()
         except xobj.XObjSerializationException, e:
diff -r c8cd900d5239 -r 88ba4997b14a py/xobj/xobj.py
--- a/py/xobj/xobj.py	Thu Dec 18 13:54:08 2008 -0500
+++ b/py/xobj/xobj.py	Thu Dec 18 15:22:16 2008 -0500
@@ -51,7 +51,7 @@
     elif xObjectType == int:
         return XType(XObjectInt)
     elif xObjectType == str:
-        return XType(XObjectStr)
+        return XType(XObject)
     elif type(xObjectType) == list:
         assert(len(xObjectType) == 1)
         return XType(XTypeFromXObjectType(xObjectType[0]).pythonType,
@@ -59,7 +59,7 @@
 
     raise UnknownXType
 
-class XObject(object):
+class AbstractXObject(object):
 
     """
     Superclass for all elements represented in XML. Subclasses of XObject
@@ -74,9 +74,8 @@
 
         class Element(xobj.XObject):
 
-            intAttr = int
-            strAttr = str
-            subelement = [ xobj.XObject ]
+            intAttr = int                       # force an int
+            subelement = [ str ]                # force a list
 
     (which is done with doc = xobj.parse("---xml string---",
                                     typeMap = { 'element' : Element } )
@@ -92,7 +91,8 @@
     _attributes = set()
 
     def __init__(self, text = None):
-        assert(text is None)
+        self._elements = [ x for x in self._elements ]
+        self._attributes = set(x for x in self._attributes)
 
     def _setAttribute(self, doc, key, val):
         expectedType = getattr(self.__class__, key, None)
@@ -114,7 +114,7 @@
                 doc._ids[val] = self
 
             expectedXType = None
-            val = XObjectStr(val)
+            val = XObject(val)
 
         self._addAttribute(key, val, xType = expectedXType)
 
@@ -205,8 +205,8 @@
         else:
             element = etree.SubElement(rootElement, tag, attrs)
 
-        if self.text is not None:
-            element.text = self.text
+        if isinstance(self, str) and self:
+            element.text = str(self)
 
         for key, val in orderedElements:
             if val is not None:
@@ -219,6 +219,19 @@
                                        nsmap = nsmap)
 
         return element
+
+
+class XObjectInt(AbstractXObject, int):
+
+    pass
+
+class XObject(str, AbstractXObject):
+
+    def __repr__(self):
+        if self:
+            return self
+        else:
+            return AbstractXObject.__repr__(self)
 
 class XID(XObject):
 
@@ -284,9 +297,6 @@
             else:
                 text = element.text
 
-            if element.tag == 'prop':
-                import epdb;epdb.st('f')
-
             tag = nsmap(element.tag)
 
             if tag in self._dynamicClassDict:
@@ -320,7 +330,10 @@
                     # the text is meaningless.
                     text = None
 
-                xobj = thisXType.pythonType(text)
+                if text:
+                    xobj = thisXType.pythonType(text)
+                else:
+                    xobj = thisXType.pythonType()
 
                 # look for unions
                 for key, val in thisXType.pythonType.__dict__.iteritems():
@@ -332,12 +345,13 @@
             else:
                 localTag = nsmap(element.tag)
                 # create a subclass for this type
-                if text is None:
-                    NewClass = type(localTag + '_XObj_Type', (XObject,), {})
+                NewClass = type(localTag + '_XObj_Type', (XObject,), {})
+                self._dynamicClassDict[tag] = XType(NewClass)
+
+                if text:
+                    xobj = NewClass(text)
                 else:
-                    NewClass = type(localTag + '_XObj_Type', (XObjectStr,), {})
-                xobj = NewClass(text)
-                self._dynamicClassDict[tag] = XType(NewClass)
+                    xobj = NewClass()
 
             # handle children
             for childElement in element.getchildren():
@@ -398,16 +412,6 @@
                 raise XObjIdNotFound(theId)
             xobj._addAttribute(tag, self._ids[theId])
 
-class XObjectInt(XObject, int):
-
-    def __init__(self, v):
-        XObject.__init__(self, None)
-
-class XObjectStr(XObject, str):
-
-    def __init__(self, v):
-        XObject.__init__(self)
-
 class XObjParseException(Exception):
 
     pass

From ewt@rpath.com Fri Dec 19 15:50:06 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBJFo65e007603
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 15:50:06 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBJFo6h1032499
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 10:50:06 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBJFo63q015246
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 10:50:06 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBJFo5TE028472
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 10:50:05 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBJFo50r028457
	for xobj-commits@lists.rpath.com; Fri, 19 Dec 2008 10:50:05 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812191550.mBJFo50r028457@scc.eng.rpath.com>
Date: Fri, 19 Dec 2008 10:50:05 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: enable xml generation from arbitrary object trees
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 19 Dec 2008 15:50:06 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

enable xml generation from arbitrary object trees

diff -r 88ba4997b14a -r f959640cac32 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Thu Dec 18 15:22:16 2008 -0500
+++ b/py/test/xobjtest.py	Thu Dec 18 16:40:20 2008 -0500
@@ -357,5 +357,33 @@
         d = xobj.parse('<top/>', typeMap = { 'top' : Top } )
         assert(d.top.items == [])
 
+    def testObjectTree(self):
+        class Top(object):
+            pass
+
+        class Middle(object):
+
+            tag = int
+
+            def foo(self):
+                pass
+
+        t = Top()
+        t.prop = 'abc'
+        t.middle = Middle()
+        t.middle.tag = 123
+
+        s = xobj.toxml(t, 'top', xml_declaration = False)
+        self.assertEquals(s, '<top>\n'
+                             '  <middle>\n'
+                             '    <tag>123</tag>\n'
+                             '  </middle>\n'
+                             '  <prop>abc</prop>\n'
+                             '</top>\n')
+
+        d = xobj.parse(s, typeMap = { 'middle' : Middle })
+        import epdb;epdb.st()
+
+
 if __name__ == "__main__":
     testsuite.main()
diff -r 88ba4997b14a -r f959640cac32 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Thu Dec 18 15:22:16 2008 -0500
+++ b/py/xobj/xobj.py	Thu Dec 18 16:40:20 2008 -0500
@@ -152,74 +152,6 @@
         else:
             setattr(self, key, [ current, val ])
 
-    def getElementTree(self, tag, rootElement = None, nsmap = {}):
-
-        def addns(s):
-            for short, long in nsmap.iteritems():
-                if short and s.startswith(short + '_'):
-                    s = '{' + long + '}' + s[len(short) + 1:]
-
-            return s
-
-        if hasattr(self, '_tag'):
-            tag = self._tag
-        else:
-            tag = addns(tag)
-
-        attrs = {}
-        elements = {}
-        for key, val in self.__dict__.iteritems():
-            if key[0] != '_':
-                if key in self._attributes:
-                    pythonType = getattr(self.__class__, key, None)
-                    if pythonType and issubclass(pythonType, XIDREF):
-                        idVal = getattr(val, 'id', None)
-                        if idVal is None:
-                            for idKey, idType in val.__class__.__dict__.iteritems():
-                                if (idKey[0] != '_' and type(idType) == type
-                                                and issubclass(idType, XID)):
-                                    idVal = getattr(val, idKey)
-
-                        if idVal is None:
-                            raise XObjSerializationException('No id found for element referenced by '
-                                                             '%s' % key)
-                        val = idVal
-
-                    key = addns(key)
-                    attrs[key] = str(val)
-                else:
-                    l = elements.setdefault(key, [])
-                    l.append(val)
-
-        orderedElements = []
-        if self._elements:
-            for name in self._elements:
-                for val in elements[name]:
-                    orderedElements.append((name, val))
-            for name in (set(elements) - set(self._elements)):
-                for val in elements[name]:
-                    orderedElements.append((name, val))
-
-        if rootElement is None:
-            element = etree.Element(tag, attrs, nsmap = nsmap)
-        else:
-            element = etree.SubElement(rootElement, tag, attrs)
-
-        if isinstance(self, str) and self:
-            element.text = str(self)
-
-        for key, val in orderedElements:
-            if val is not None:
-                if type(val) == list:
-                    for subval in val:
-                        subval.getElementTree(key, rootElement = element,
-                                              nsmap = nsmap)
-                else:
-                    val.getElementTree(key, rootElement = element,
-                                       nsmap = nsmap)
-
-        return element
-
 
 class XObjectInt(AbstractXObject, int):
 
@@ -229,7 +161,7 @@
 
     def __repr__(self):
         if self:
-            return self
+            return str.__repr__(self)
         else:
             return AbstractXObject.__repr__(self)
 
@@ -253,6 +185,87 @@
         self.__explicitNamespaces = False
         self.__xmlNsMap = {}
 
+    def getElementTree(self, xobj, tag, rootElement = None, nsmap = {}):
+
+        def addns(s):
+            for short, long in nsmap.iteritems():
+                if short and s.startswith(short + '_'):
+                    s = '{' + long + '}' + s[len(short) + 1:]
+
+            return s
+
+        if type(xobj) == int:
+            xobj = str(xobj)
+
+        if type(xobj) == str:
+            element = etree.SubElement(rootElement, tag, {})
+            element.text = xobj
+            return element
+
+        if hasattr(xobj, '_tag'):
+            tag = xobj._tag
+        else:
+            tag = addns(tag)
+
+        attrSet = getattr(xobj, '_attributes', set())
+
+        attrs = {}
+        elements = {}
+        for key, val in xobj.__dict__.iteritems():
+            if key[0] != '_':
+                if key in attrSet:
+                    pythonType = getattr(xobj.__class__, key, None)
+                    if pythonType and issubclass(pythonType, XIDREF):
+                        idVal = getattr(val, 'id', None)
+                        if idVal is None:
+                            for idKey, idType in val.__class__.__dict__.iteritems():
+                                if (idKey[0] != '_' and type(idType) == type
+                                                and issubclass(idType, XID)):
+                                    idVal = getattr(val, idKey)
+
+                        if idVal is None:
+                            raise XObjSerializationException('No id found for element referenced by '
+                                                             '%s' % key)
+                        val = idVal
+
+                    key = addns(key)
+                    attrs[key] = str(val)
+                else:
+                    l = elements.setdefault(key, [])
+                    l.append(val)
+
+        orderedElements = []
+
+        if hasattr(xobj, '_elements'):
+            for name in xobj._elements:
+                for val in elements[name]:
+                    orderedElements.append((name, val))
+            for name in (set(elements) - set(xobj._elements)):
+                for val in elements[name]:
+                    orderedElements.append((name, val))
+        else:
+            orderedElements = sorted(elements.iteritems())
+
+        if rootElement is None:
+            element = etree.Element(tag, attrs, nsmap = nsmap)
+        else:
+            element = etree.SubElement(rootElement, tag, attrs)
+
+        if isinstance(xobj, str) and xobj:
+            element.text = str(xobj)
+
+        for key, val in orderedElements:
+            if val is not None:
+                if type(val) == list:
+                    for subval in val:
+                        self.getElementTree(subval, key, rootElement = element,
+                                              nsmap = nsmap)
+                else:
+                    self.getElementTree(val, key, rootElement = element,
+                                       nsmap = nsmap)
+
+        return element
+
     def tostring(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
         for key, val in self.__dict__.iteritems():
             if key[0] == '_': continue
@@ -265,7 +278,7 @@
         else:
             map = self.__xmlNsMap
 
-        et = val.getElementTree(key, nsmap = map)
+        et = self.getElementTree(val, key, nsmap = map)
         xmlString = etree.tostring(et, pretty_print = prettyPrint,
                                    encoding = 'UTF-8',
                                    xml_declaration = xml_declaration)
@@ -451,4 +464,11 @@
     s = StringIO(s)
     return parsef(s, schemaf, documentClass = documentClass, typeMap = typeMap)
 
+def toxml(xobj, tag, prettyPrint = True, xml_declaration = True):
+    d = Document()
+    et = d.getElementTree(xobj, tag)
+    xmlString = etree.tostring(et, pretty_print = prettyPrint,
+                               encoding = 'UTF-8',
+                               xml_declaration = xml_declaration)
 
+    return xmlString

From ewt@rpath.com Fri Dec 19 15:50:07 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBJFo73G007606
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 15:50:07 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBJFo7E1032511
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 10:50:07 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBJFo7Fq015250
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 10:50:07 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBJFo6nk028502
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 10:50:06 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBJFo6CH028497
	for xobj-commits@lists.rpath.com; Fri, 19 Dec 2008 10:50:06 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812191550.mBJFo6CH028497@scc.eng.rpath.com>
Date: Fri, 19 Dec 2008 10:50:06 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: breakpoint/formatting cleanups
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 19 Dec 2008 15:50:07 -0000

tag:         tip
user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

breakpoint/formatting cleanups

diff -r f959640cac32 -r 0fcdcebb2fe7 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Thu Dec 18 16:40:20 2008 -0500
+++ b/py/test/xobjtest.py	Thu Dec 18 18:12:36 2008 -0500
@@ -381,9 +381,7 @@
                              '  <prop>abc</prop>\n'
                              '</top>\n')
 
-        d = xobj.parse(s, typeMap = { 'middle' : Middle })
-        import epdb;epdb.st()
-
+        d = xobj.parse(s)
 
 if __name__ == "__main__":
     testsuite.main()
diff -r f959640cac32 -r 0fcdcebb2fe7 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Thu Dec 18 16:40:20 2008 -0500
+++ b/py/xobj/xobj.py	Thu Dec 18 18:12:36 2008 -0500
@@ -143,9 +143,9 @@
                 setattr(self, key, current)
 
         if self.__dict__.get(key, None) is None:
-            # This has not yet been set in the instance (because it's missing) or it's been
-            # set to None (because we think we don't have this value but it's actually an idref
-            # being filled in later)
+            # This has not yet been set in the instance (because it's missing)
+            # or it's been set to None (because we think we don't have this
+            # value but it's actually an idref being filled in later)
             setattr(self, key, val)
         elif type(current) == list:
             current.append(val)
@@ -218,14 +218,16 @@
                     if pythonType and issubclass(pythonType, XIDREF):
                         idVal = getattr(val, 'id', None)
                         if idVal is None:
-                            for idKey, idType in val.__class__.__dict__.iteritems():
+                            for idKey, idType in (
+                                        val.__class__.__dict__.iteritems()):
                                 if (idKey[0] != '_' and type(idType) == type
                                                 and issubclass(idType, XID)):
                                     idVal = getattr(val, idKey)
 
                         if idVal is None:
-                            raise XObjSerializationException('No id found for element referenced by '
-                                                             '%s' % key)
+                            raise XObjSerializationException(
+                                    'No id found for element referenced by %s'
+                                    % key)
                         val = idVal
 
                     key = addns(key)

From ewt@rpath.com Fri Dec 19 19:13:16 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBJJDGxM010914
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 19:13:16 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBJJDFKd029496
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 14:13:15 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBJJDFkT030010
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 14:13:15 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBJJDFGU005520
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 14:13:15 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBJJDFkC005515
	for xobj-commits@lists.rpath.com; Fri, 19 Dec 2008 14:13:15 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812191913.mBJJDFkC005515@scc.eng.rpath.com>
Date: Fri, 19 Dec 2008 14:13:14 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: added complex/union xml files
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 19 Dec 2008 19:13:16 -0000

tag:         tip
user:        Erik Troan <http://issues.rpath.com>
files:       test/complex.xml test/union.xml

added complex/union xml files

diff -r 0fcdcebb2fe7 -r d3019954d9ff test/complex.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/complex.xml	Fri Dec 19 14:13:12 2008 -0500
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<top>
+  <prop>
+    <subprop subattr="1">asdf</subprop>
+    <subprop subattr="2">fdsa</subprop>
+  </prop>
+  <simple>simple</simple>
+</top>
diff -r 0fcdcebb2fe7 -r d3019954d9ff test/union.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/union.xml	Fri Dec 19 14:13:12 2008 -0500
@@ -0,0 +1,7 @@
+<top>
+  <typea vala="1"/>
+  <typeb valb="2"/>
+  <typea vala="3"/>
+  <typeb valb="4"/>
+  <typea vala="5"/>
+</top>

From bpja@rpath.com Sat Dec 20 03:57:05 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBK3v5Bq018972
	for <xobj-commits@lists.rpath.com>; Sat, 20 Dec 2008 03:57:05 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBK3v58U028593
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 22:57:05 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBK3v4YB031101
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 22:57:04 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBK3v4Xd020895
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 22:57:04 -0500
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBK3v39E020875
	for xobj-commits@lists.rpath.com; Fri, 19 Dec 2008 22:57:03 -0500
From: Brett Adam <bpja@rpath.com>
Message-Id: <200812200357.mBK3v39E020875@scc.eng.rpath.com>
Date: Fri, 19 Dec 2008 22:57:03 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Remove redundant license file
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Sat, 20 Dec 2008 03:57:05 -0000

user:        Brett Adam bpja@rpath.com
files:       as3/LICENSE

Remove redundant license file

diff -r ee95481c4e68 -r 58a83af94233 as3/LICENSE
--- a/as3/LICENSE	Thu Dec 18 16:14:24 2008 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-Copyright (c) 2005 rPath, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-of the Software, and to permit persons to whom the Software is furnished to do
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

From bpja@rpath.com Sat Dec 20 03:57:06 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBK3v6JA018975
	for <xobj-commits@lists.rpath.com>; Sat, 20 Dec 2008 03:57:06 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBK3v51L028600
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 22:57:05 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBK3v53W031104
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 22:57:05 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBK3v4kj020922
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 22:57:04 -0500
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBK3v4HF020912
	for xobj-commits@lists.rpath.com; Fri, 19 Dec 2008 22:57:04 -0500
From: Brett Adam <bpja@rpath.com>
Message-Id: <200812200357.mBK3v4HF020912@scc.eng.rpath.com>
Date: Fri, 19 Dec 2008 22:57:04 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Ignore AS3 read-only prototype property on encoding. Ensure
	missing type info doesn't prevent typeMap being used correctly
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Sat, 20 Dec 2008 03:57:06 -0000

user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as

Ignore AS3 read-only prototype property on encoding. Ensure missing type info doesn't prevent typeMap being used correctly

diff -r 58a83af94233 -r 1d8f0e379284 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Thu Dec 18 16:29:01 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Thu Dec 18 17:03:08 2008 -0500
@@ -1,13 +1,9 @@
 package com.rpath.xobj
 {
+    import flash.utils.getDefinitionByName;
     import flash.xml.XMLNode;
-    import flash.utils.getDefinitionByName;
-    import flash.utils.getQualifiedClassName;
-    import flash.xml.XMLNodeType;
     
-    import mx.collections.ArrayCollection;
     import mx.utils.DescribeTypeCache;
-    import mx.utils.ObjectProxy;
 
     
     public class XObjUtils
@@ -57,16 +53,18 @@
       */
     public static function getClassByName(className:String):Class
     {
-        if (className != "Object")
+        var classReference:Class = null;
+        
+        try
         {
-            var classReference:Class = getDefinitionByName(className) as Class;
-            return classReference;
+             classReference = getDefinitionByName(className) as Class;
         } 
-        else
+        catch (e:ReferenceError)
         {
-            return Object;
+            trace("Request for unknown class "+className);
         }
 
+        return classReference;
      }    
      
     private static var typePropertyCache:Object = {};
diff -r 58a83af94233 -r 1d8f0e379284 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Thu Dec 18 16:29:01 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Thu Dec 18 17:03:08 2008 -0500
@@ -209,11 +209,12 @@
      *
      *  @return A tree of ActionScript Objects.
      */
-    public function decodeXML(dataNode:XMLNode, isTypedProperty:Boolean = false, propType:Class = null):Object
+    public function decodeXML(dataNode:XMLNode, propType:Class = null):Object
     {
         var result:*;
         var isSimpleType:Boolean = false;
         var shouldMakeBindable:Boolean = false;
+        var isTypedProperty:Boolean = false;
         var isTypedNode:Boolean = false;
         var isSpecifiedType:Boolean = false;
         var elementSet:Array = [];
@@ -233,6 +234,7 @@
         Or it could be the element name maps to a type in the TypeMap
         
         */
+        isTypedProperty = (propType != null);
         
         var nodeType:Class = typeForTag(dataNode.nodeName);
         isTypedNode = (nodeType != null);
@@ -354,10 +356,14 @@
                     
                     if (partTypeName != null)
                     {
-                        partObj = decodeXML(partNode, true, XObjUtils.getClassByName(partTypeName));
+                        var partClass:Class = XObjUtils.getClassByName(partTypeName);
+                        if (partClass)
+                            partObj = decodeXML(partNode, partClass);
+                        else
+                            partObj = decodeXML(partNode);
                     }
                     else
-                        partObj = decodeXML(partNode, false);
+                        partObj = decodeXML(partNode);
     
                     if (seenProperties[partName])
                     {
diff -r 58a83af94233 -r 1d8f0e379284 as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as	Thu Dec 18 16:29:01 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as	Thu Dec 18 17:03:08 2008 -0500
@@ -263,7 +263,7 @@
             myElement.nodeName = XObjUtils.encodeElementTag(qname, myElement);
             
             // TODO: this is expensive. Can we optimize?
-            var classInfo:Object = ObjectUtil.getClassInfo(obj, [XObjMetadata.METADATA_PROPERTY, "attributes"], CLASS_INFO_OPTIONS);
+            var classInfo:Object = ObjectUtil.getClassInfo(obj, [XObjMetadata.METADATA_PROPERTY, "attributes", "prototype"], CLASS_INFO_OPTIONS);
             var properties:Array = (classInfo.properties as Array);
             
             var propsDone:Object = {};

From bpja@rpath.com Sat Dec 20 03:57:07 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBK3v7Pq018981
	for <xobj-commits@lists.rpath.com>; Sat, 20 Dec 2008 03:57:07 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBK3v72I028607
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 22:57:07 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBK3v75e031107
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 22:57:07 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBK3v6CB020984
	for <xobj-commits@lists.rpath.com>; Fri, 19 Dec 2008 22:57:06 -0500
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBK3v6w4020975
	for xobj-commits@lists.rpath.com; Fri, 19 Dec 2008 22:57:06 -0500
From: Brett Adam <bpja@rpath.com>
Message-Id: <200812200357.mBK3v6w4020975@scc.eng.rpath.com>
Date: Fri, 19 Dec 2008 22:57:06 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Test cases mirroring the python test cases,
	using same test data files
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by localhost.localdomain
	id mBK3v7Pq018981
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Sat, 20 Dec 2008 03:57:08 -0000

user:        Brett Adam bpja@rpath.com
files:       as3/XObjExplorer/src/XObjExplorer.mxml as3/XObjExplorer/src/test/Envelope.as as3/XObjExplorer/src/test/File.as as3/XObjExplorer/src/test/OVFId.as as3/XObjExplorer/src/test/TestObject.as as3/xobjas3-test/.actionScriptProperties as3/xobjas3-test/.flexProperties as3/xobjas3-test/.project as3/xobjas3-test/.settings/org.eclipse.core.resources.prefs as3/xobjas3-test/html-template/AC_OETags.js as3/xobjas3-test/html-template/history/history.css as3/xobjas3-test/html-template/history/history.js as3/xobjas3-test/html-template/history/historyFrame.html as3/xobjas3-test/html-template/index.template.html as3/xobjas3-test/src/TestConfiguration.as as3/xobjas3-test/src/TestRunnerModules.mxml as3/xobjas3-test/src/TestSuite1.as as3/xobjas3-test/src/WebTestRunner.mxml as3/xobjas3-test/src/tests/TestBase.as as3/xobjas3-test/src/tests/TestBasics.as as3/xobjas3-test/src/tests/TestData.mxml as3/xobjas3-test/src/tests/models/Middle.as as3/xobjas3-test/src/tests/models/Top.as as3/xobjas3-test/test as3/xobjas3/src/com/rpath/xobj/SchemaAwareXMLDecoder.as as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as as3/xobjas3/src/com/rpath/xobj/XObjQName.as as3/xobjas3/src/com/rpath/xobj/XObjString.as as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as

Test cases mirroring the python test cases, using same test data files

diff -r 87487951f258 -r 703a09ec1a1d as3/XObjExplorer/src/XObjExplorer.mxml
--- a/as3/XObjExplorer/src/XObjExplorer.mxml	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/XObjExplorer/src/XObjExplorer.mxml	Fri Dec 19 22:52:39 2008 -0500
@@ -1,4 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!--
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+-->
+
 <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
     creationComplete="creationComplete()">
 
@@ -216,7 +229,7 @@
                 { _default_ : "http://schemas.dmtf.org/ovf/envelope/1" }, myXML);
             xmlNode = typedEncoder.encodeObject(testObject, myXML);
             // this is disgusting. Says somehting is wrong in XMLDecode
-            unformattedOutput = myXML.firstChild.firstChild.toString();
+            unformattedOutput = xmlNode.firstChild.toString();
             break;
             
             case "SCHEMA":
diff -r 87487951f258 -r 703a09ec1a1d as3/XObjExplorer/src/test/Envelope.as
--- a/as3/XObjExplorer/src/test/Envelope.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/XObjExplorer/src/test/Envelope.as	Fri Dec 19 22:52:39 2008 -0500
@@ -1,3 +1,16 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
 package test
 {
     [Bindable]
diff -r 87487951f258 -r 703a09ec1a1d as3/XObjExplorer/src/test/File.as
--- a/as3/XObjExplorer/src/test/File.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/XObjExplorer/src/test/File.as	Fri Dec 19 22:52:39 2008 -0500
@@ -1,3 +1,16 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
 package test
 {
     import flash.utils.Dictionary;
diff -r 87487951f258 -r 703a09ec1a1d as3/XObjExplorer/src/test/OVFId.as
--- a/as3/XObjExplorer/src/test/OVFId.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/XObjExplorer/src/test/OVFId.as	Fri Dec 19 22:52:39 2008 -0500
@@ -1,3 +1,16 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
 package test
 {
     [Bindable]
diff -r 87487951f258 -r 703a09ec1a1d as3/XObjExplorer/src/test/TestObject.as
--- a/as3/XObjExplorer/src/test/TestObject.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/XObjExplorer/src/test/TestObject.as	Fri Dec 19 22:52:39 2008 -0500
@@ -1,3 +1,16 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
 package test
 {
     
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/.actionScriptProperties
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/.actionScriptProperties	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<actionScriptProperties mainApplicationPath="WebTestRunner.mxml" version="3">
+<compiler additionalCompilerArguments="-locale en_US" copyDependentFiles="true" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+<compilerSourcePath/>
+<libraryPath defaultLinkType="1">
+<libraryPathEntry kind="4" path=""/>
+<libraryPathEntry kind="3" linkType="1" path="/fluint/bin/fluint.swc" useDefaultLinkType="false"/>
+<libraryPathEntry kind="3" linkType="1" path="/xobjas3/bin/xobjas3.swc" useDefaultLinkType="false"/>
+</libraryPath>
+<sourceAttachmentPath/>
+</compiler>
+<applications>
+<application path="WebTestRunner.mxml"/>
+</applications>
+<modules/>
+<buildCSSFiles/>
+</actionScriptProperties>
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/.flexProperties
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/.flexProperties	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flexProperties flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="1"/>
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/.project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/.project	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>xobjas3-test</name>
+	<comment></comment>
+	<projects>
+		<project>fluint</project>
+		<project>xobjas3</project>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/.settings/org.eclipse.core.resources.prefs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/.settings/org.eclipse.core.resources.prefs	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,3 @@
+#Thu Dec 18 20:01:40 EST 2008
+eclipse.preferences.version=1
+encoding/<project>=utf-8
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/html-template/AC_OETags.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/html-template/AC_OETags.js	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,292 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+	var version;
+	var axo;
+	var e;
+
+	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+	try {
+		// version will be set for 7.X or greater players
+		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+		version = axo.GetVariable("$version");
+	} catch (e) {
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 6.X players only
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+			
+			// installed player is some revision of 6.0
+			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+			// so we have to be careful. 
+			
+			// default to the first public version
+			version = "WIN 6,0,21,0";
+
+			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
+			axo.AllowScriptAccess = "always";
+
+			// safe to call for 6.0r47 or greater
+			version = axo.GetVariable("$version");
+
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 4.X or 5.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = axo.GetVariable("$version");
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 3.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = "WIN 3,0,18,0";
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 2.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+			version = "WIN 2,0,0,11";
+		} catch (e) {
+			version = -1;
+		}
+	}
+	
+	return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+	// NS/Opera version >= 3 check for Flash plugin in plugin array
+	var flashVer = -1;
+	
+	if (navigator.plugins != null && navigator.plugins.length > 0) {
+		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+			var descArray = flashDescription.split(" ");
+			var tempArrayMajor = descArray[2].split(".");			
+			var versionMajor = tempArrayMajor[0];
+			var versionMinor = tempArrayMajor[1];
+			var versionRevision = descArray[3];
+			if (versionRevision == "") {
+				versionRevision = descArray[4];
+			}
+			if (versionRevision[0] == "d") {
+				versionRevision = versionRevision.substring(1);
+			} else if (versionRevision[0] == "r") {
+				versionRevision = versionRevision.substring(1);
+				if (versionRevision.indexOf("d") > 0) {
+					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+				}
+			} else if (versionRevision[0] == "b") {
+				versionRevision = versionRevision.substring(1);
+			}
+			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+		}
+	}
+	// MSN/WebTV 2.6 supports Flash 4
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+	// WebTV 2.5 supports Flash 3
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+	// older WebTV supports Flash 2
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+	else if ( isIE && isWin && !isOpera ) {
+		flashVer = ControlVersion();
+	}
+	return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+	versionStr = GetSwfVer();
+	if (versionStr == -1 ) {
+		return false;
+	} else if (versionStr != 0) {
+		if(isIE && isWin && !isOpera) {
+			// Given "WIN 2,0,0,11"
+			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
+			tempString        = tempArray[1];			// "2,0,0,11"
+			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
+		} else {
+			versionArray      = versionStr.split(".");
+		}
+		var versionMajor      = versionArray[0];
+		var versionMinor      = versionArray[1];
+		var versionRevision   = versionArray[2];
+
+        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
+		if (versionMajor > parseFloat(reqMajorVer)) {
+			return true;
+		} else if (versionMajor == parseFloat(reqMajorVer)) {
+			if (versionMinor > parseFloat(reqMinorVer))
+				return true;
+			else if (versionMinor == parseFloat(reqMinorVer)) {
+				if (versionRevision >= parseFloat(reqRevision))
+					return true;
+			}
+		}
+		return false;
+	}
+}
+
+function AC_AddExtension(src, ext)
+{
+  var qIndex = src.indexOf('?');
+  if ( qIndex != -1)
+  {
+    // Add the extention (if needed) before the query params
+    var path = src.substring(0, qIndex);
+    if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
+      return src;
+    else
+      return src.replace(/\?/, ext+'?'); 
+  }
+  else
+  {
+    // Add the extension (if needed) to the end of the URL
+    if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
+      return src;  // Already have extension
+    else
+      return src + ext;
+  }
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs) 
+{ 
+    var str = '';
+    if (isIE && isWin && !isOpera)
+    {
+  		str += '<object ';
+  		for (var i in objAttrs)
+  			str += i + '="' + objAttrs[i] + '" ';
+  		str += '>';
+  		for (var i in params)
+  			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
+  		str += '</object>';
+    } else {
+  		str += '<embed ';
+  		for (var i in embedAttrs)
+  			str += i + '="' + embedAttrs[i] + '" ';
+  		str += '> </embed>';
+    }
+
+    document.write(str);
+}
+
+function AC_FL_RunContent(){
+  var ret = 
+    AC_GetArgs
+    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+     , "application/x-shockwave-flash"
+    );
+  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+  var ret = new Object();
+  ret.embedAttrs = new Object();
+  ret.params = new Object();
+  ret.objAttrs = new Object();
+  for (var i=0; i < args.length; i=i+2){
+    var currArg = args[i].toLowerCase();    
+
+    switch (currArg){	
+      case "classid":
+        break;
+      case "pluginspage":
+        ret.embedAttrs[args[i]] = args[i+1];
+        break;
+      case "src":
+      case "movie":	
+        args[i+1] = AC_AddExtension(args[i+1], ext);
+        ret.embedAttrs["src"] = args[i+1];
+        ret.params[srcParamName] = args[i+1];
+        break;
+      case "onafterupdate":
+      case "onbeforeupdate":
+      case "onblur":
+      case "oncellchange":
+      case "onclick":
+      case "ondblClick":
+      case "ondrag":
+      case "ondragend":
+      case "ondragenter":
+      case "ondragleave":
+      case "ondragover":
+      case "ondrop":
+      case "onfinish":
+      case "onfocus":
+      case "onhelp":
+      case "onmousedown":
+      case "onmouseup":
+      case "onmouseover":
+      case "onmousemove":
+      case "onmouseout":
+      case "onkeypress":
+      case "onkeydown":
+      case "onkeyup":
+      case "onload":
+      case "onlosecapture":
+      case "onpropertychange":
+      case "onreadystatechange":
+      case "onrowsdelete":
+      case "onrowenter":
+      case "onrowexit":
+      case "onrowsinserted":
+      case "onstart":
+      case "onscroll":
+      case "onbeforeeditfocus":
+      case "onactivate":
+      case "onbeforedeactivate":
+      case "ondeactivate":
+      case "type":
+      case "codebase":
+        ret.objAttrs[args[i]] = args[i+1];
+        break;
+      case "id":
+      case "width":
+      case "height":
+      case "align":
+      case "vspace": 
+      case "hspace":
+      case "class":
+      case "title":
+      case "accesskey":
+      case "name":
+      case "tabindex":
+        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+        break;
+      default:
+        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+    }
+  }
+  ret.objAttrs["classid"] = classid;
+  if (mimeType) ret.embedAttrs["type"] = mimeType;
+  return ret;
+}
+
+
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/html-template/history/history.css
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/html-template/history/history.css	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,6 @@
+/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
+
+#ie_historyFrame { width: 0px; height: 0px; display:none }
+#firefox_anchorDiv { width: 0px; height: 0px; display:none }
+#safari_formDiv { width: 0px; height: 0px; display:none }
+#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/html-template/history/history.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/html-template/history/history.js	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,662 @@
+BrowserHistoryUtils = {
+    addEvent: function(elm, evType, fn, useCapture) {
+        useCapture = useCapture || false;
+        if (elm.addEventListener) {
+            elm.addEventListener(evType, fn, useCapture);
+            return true;
+        }
+        else if (elm.attachEvent) {
+            var r = elm.attachEvent('on' + evType, fn);
+            return r;
+        }
+        else {
+            elm['on' + evType] = fn;
+        }
+    }
+}
+
+BrowserHistory = (function() {
+    // type of browser
+    var browser = {
+        ie: false, 
+        firefox: false, 
+        safari: false, 
+        opera: false, 
+        version: -1
+    };
+
+    // if setDefaultURL has been called, our first clue
+    // that the SWF is ready and listening
+    //var swfReady = false;
+
+    // the URL we'll send to the SWF once it is ready
+    //var pendingURL = '';
+
+    // Default app state URL to use when no fragment ID present
+    var defaultHash = '';
+
+    // Last-known app state URL
+    var currentHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHref = document.location.href;
+
+    // Initial URL (used only by IE)
+    var initialHash = document.location.hash;
+
+    // History frame source URL prefix (used only by IE)
+    var historyFrameSourcePrefix = 'history/historyFrame.html?';
+
+    // History maintenance (used only by Safari)
+    var currentHistoryLength = -1;
+
+    var historyHash = [];
+
+    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
+
+    var backStack = [];
+    var forwardStack = [];
+
+    var currentObjectId = null;
+
+    //UserAgent detection
+    var useragent = navigator.userAgent.toLowerCase();
+
+    if (useragent.indexOf("opera") != -1) {
+        browser.opera = true;
+    } else if (useragent.indexOf("msie") != -1) {
+        browser.ie = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
+    } else if (useragent.indexOf("safari") != -1) {
+        browser.safari = true;
+        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
+    } else if (useragent.indexOf("gecko") != -1) {
+        browser.firefox = true;
+    }
+
+    if (browser.ie == true && browser.version == 7) {
+        window["_ie_firstload"] = false;
+    }
+
+    // Accessor functions for obtaining specific elements of the page.
+    function getHistoryFrame()
+    {
+        return document.getElementById('ie_historyFrame');
+    }
+
+    function getAnchorElement()
+    {
+        return document.getElementById('firefox_anchorDiv');
+    }
+
+    function getFormElement()
+    {
+        return document.getElementById('safari_formDiv');
+    }
+
+    function getRememberElement()
+    {
+        return document.getElementById("safari_remember_field");
+    }
+
+    // Get the Flash player object for performing ExternalInterface callbacks.
+    // Updated for changes to SWFObject2.
+    function getPlayer(id) {
+		if (id && document.getElementById(id)) {
+			var r = document.getElementById(id);
+			if (typeof r.SetVariable != "undefined") {
+				return r;
+			}
+			else {
+				var o = r.getElementsByTagName("object");
+				var e = r.getElementsByTagName("embed");
+				if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+					return o[0];
+				}
+				else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+					return e[0];
+				}
+			}
+		}
+		else {
+			var o = document.getElementsByTagName("object");
+			var e = document.getElementsByTagName("embed");
+			if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
+				return e[0];
+			}
+			else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
+				return o[0];
+			}
+			else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
+				return o[1];
+			}
+		}
+		return undefined;
+	}
+    
+    function getPlayers() {
+        var players = [];
+        if (players.length == 0) {
+            var tmp = document.getElementsByTagName('object');
+            players = tmp;
+        }
+        
+        if (players.length == 0 || players[0].object == null) {
+            var tmp = document.getElementsByTagName('embed');
+            players = tmp;
+        }
+        return players;
+    }
+
+	function getIframeHash() {
+		var doc = getHistoryFrame().contentWindow.document;
+		var hash = String(doc.location.search);
+		if (hash.length == 1 && hash.charAt(0) == "?") {
+			hash = "";
+		}
+		else if (hash.length >= 2 && hash.charAt(0) == "?") {
+			hash = hash.substring(1);
+		}
+		return hash;
+	}
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function getHash() {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       var idx = document.location.href.indexOf('#');
+       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
+    }
+
+    /* Get the current location hash excluding the '#' symbol. */
+    function setHash(hash) {
+       // It would be nice if we could use document.location.hash here,
+       // but it's faulty sometimes.
+       if (hash == '') hash = '#'
+       document.location.hash = hash;
+    }
+
+    function createState(baseUrl, newUrl, flexAppUrl) {
+        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
+    }
+
+    /* Add a history entry to the browser.
+     *   baseUrl: the portion of the location prior to the '#'
+     *   newUrl: the entire new URL, including '#' and following fragment
+     *   flexAppUrl: the portion of the location following the '#' only
+     */
+    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
+
+        //delete all the history entries
+        forwardStack = [];
+
+        if (browser.ie) {
+            //Check to see if we are being asked to do a navigate for the first
+            //history entry, and if so ignore, because it's coming from the creation
+            //of the history iframe
+            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
+                currentHref = initialHref;
+                return;
+            }
+            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
+                newUrl = baseUrl + '#' + defaultHash;
+                flexAppUrl = defaultHash;
+            } else {
+                // for IE, tell the history frame to go somewhere without a '#'
+                // in order to get this entry into the browser history.
+                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
+            }
+            setHash(flexAppUrl);
+        } else {
+
+            //ADR
+            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
+                initialState = createState(baseUrl, newUrl, flexAppUrl);
+            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
+                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
+            }
+
+            if (browser.safari) {
+                // for Safari, submit a form whose action points to the desired URL
+                if (browser.version <= 419.3) {
+                    var file = window.location.pathname.toString();
+                    file = file.substring(file.lastIndexOf("/")+1);
+                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
+                    //get the current elements and add them to the form
+                    var qs = window.location.search.substring(1);
+                    var qs_arr = qs.split("&");
+                    for (var i = 0; i < qs_arr.length; i++) {
+                        var tmp = qs_arr[i].split("=");
+                        var elem = document.createElement("input");
+                        elem.type = "hidden";
+                        elem.name = tmp[0];
+                        elem.value = tmp[1];
+                        document.forms.historyForm.appendChild(elem);
+                    }
+                    document.forms.historyForm.submit();
+                } else {
+                    top.location.hash = flexAppUrl;
+                }
+                // We also have to maintain the history by hand for Safari
+                historyHash[history.length] = flexAppUrl;
+                _storeStates();
+            } else {
+                // Otherwise, write an anchor into the page and tell the browser to go there
+                addAnchor(flexAppUrl);
+                setHash(flexAppUrl);
+            }
+        }
+        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
+    }
+
+    function _storeStates() {
+        if (browser.safari) {
+            getRememberElement().value = historyHash.join(",");
+        }
+    }
+
+    function handleBackButton() {
+        //The "current" page is always at the top of the history stack.
+        var current = backStack.pop();
+        if (!current) { return; }
+        var last = backStack[backStack.length - 1];
+        if (!last && backStack.length == 0){
+            last = initialState;
+        }
+        forwardStack.push(current);
+    }
+
+    function handleForwardButton() {
+        //summary: private method. Do not call this directly.
+
+        var last = forwardStack.pop();
+        if (!last) { return; }
+        backStack.push(last);
+    }
+
+    function handleArbitraryUrl() {
+        //delete all the history entries
+        forwardStack = [];
+    }
+
+    /* Called periodically to poll to see if we need to detect navigation that has occurred */
+    function checkForUrlChange() {
+
+        if (browser.ie) {
+            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
+                //This occurs when the user has navigated to a specific URL
+                //within the app, and didn't use browser back/forward
+                //IE seems to have a bug where it stops updating the URL it
+                //shows the end-user at this point, but programatically it
+                //appears to be correct.  Do a full app reload to get around
+                //this issue.
+                if (browser.version < 7) {
+                    currentHref = document.location.href;
+                    document.location.reload();
+                } else {
+					if (getHash() != getIframeHash()) {
+						// this.iframe.src = this.blankURL + hash;
+						var sourceToSet = historyFrameSourcePrefix + getHash();
+						getHistoryFrame().src = sourceToSet;
+					}
+                }
+            }
+        }
+
+        if (browser.safari) {
+            // For Safari, we have to check to see if history.length changed.
+            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
+                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
+                // If it did change, then we have to look the old state up
+                // in our hand-maintained array since document.location.hash
+                // won't have changed, then call back into BrowserManager.
+                currentHistoryLength = history.length;
+                var flexAppUrl = historyHash[currentHistoryLength];
+                if (flexAppUrl == '') {
+                    //flexAppUrl = defaultHash;
+                }
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+                _storeStates();
+            }
+        }
+        if (browser.firefox) {
+            if (currentHref != document.location.href) {
+                var bsl = backStack.length;
+
+                var urlActions = {
+                    back: false, 
+                    forward: false, 
+                    set: false
+                }
+
+                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
+                    urlActions.back = true;
+                    // FIXME: could this ever be a forward button?
+                    // we can't clear it because we still need to check for forwards. Ugg.
+                    // clearInterval(this.locationTimer);
+                    handleBackButton();
+                }
+                
+                // first check to see if we could have gone forward. We always halt on
+                // a no-hash item.
+                if (forwardStack.length > 0) {
+                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
+                        urlActions.forward = true;
+                        handleForwardButton();
+                    }
+                }
+
+                // ok, that didn't work, try someplace back in the history stack
+                if ((bsl >= 2) && (backStack[bsl - 2])) {
+                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
+                        urlActions.back = true;
+                        handleBackButton();
+                    }
+                }
+                
+                if (!urlActions.back && !urlActions.forward) {
+                    var foundInStacks = {
+                        back: -1, 
+                        forward: -1
+                    }
+
+                    for (var i = 0; i < backStack.length; i++) {
+                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.back = i;
+                        }
+                    }
+                    for (var i = 0; i < forwardStack.length; i++) {
+                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
+                            arbitraryUrl = true;
+                            foundInStacks.forward = i;
+                        }
+                    }
+                    handleArbitraryUrl();
+                }
+
+                // Firefox changed; do a callback into BrowserManager to tell it.
+                currentHref = document.location.href;
+                var flexAppUrl = getHash();
+                if (flexAppUrl == '') {
+                    //flexAppUrl = defaultHash;
+                }
+                //ADR: to fix multiple
+                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                    var pl = getPlayers();
+                    for (var i = 0; i < pl.length; i++) {
+                        pl[i].browserURLChange(flexAppUrl);
+                    }
+                } else {
+                    getPlayer().browserURLChange(flexAppUrl);
+                }
+            }
+        }
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
+    function addAnchor(flexAppUrl)
+    {
+       if (document.getElementsByName(flexAppUrl).length == 0) {
+           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
+       }
+    }
+
+    var _initialize = function () {
+        if (browser.ie)
+        {
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
+                }
+            }
+            historyFrameSourcePrefix = iframe_location + "?";
+            var src = historyFrameSourcePrefix;
+
+            var iframe = document.createElement("iframe");
+            iframe.id = 'ie_historyFrame';
+            iframe.name = 'ie_historyFrame';
+            //iframe.src = historyFrameSourcePrefix;
+            try {
+                document.body.appendChild(iframe);
+            } catch(e) {
+                setTimeout(function() {
+                    document.body.appendChild(iframe);
+                }, 0);
+            }
+        }
+
+        if (browser.safari)
+        {
+            var rememberDiv = document.createElement("div");
+            rememberDiv.id = 'safari_rememberDiv';
+            document.body.appendChild(rememberDiv);
+            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
+
+            var formDiv = document.createElement("div");
+            formDiv.id = 'safari_formDiv';
+            document.body.appendChild(formDiv);
+
+            var reloader_content = document.createElement('div');
+            reloader_content.id = 'safarireloader';
+            var scripts = document.getElementsByTagName('script');
+            for (var i = 0, s; s = scripts[i]; i++) {
+                if (s.src.indexOf("history.js") > -1) {
+                    html = (new String(s.src)).replace(".js", ".html");
+                }
+            }
+            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
+            document.body.appendChild(reloader_content);
+            reloader_content.style.position = 'absolute';
+            reloader_content.style.left = reloader_content.style.top = '-9999px';
+            iframe = reloader_content.getElementsByTagName('iframe')[0];
+
+            if (document.getElementById("safari_remember_field").value != "" ) {
+                historyHash = document.getElementById("safari_remember_field").value.split(",");
+            }
+
+        }
+
+        if (browser.firefox)
+        {
+            var anchorDiv = document.createElement("div");
+            anchorDiv.id = 'firefox_anchorDiv';
+            document.body.appendChild(anchorDiv);
+        }
+        
+        //setTimeout(checkForUrlChange, 50);
+    }
+
+    return {
+        historyHash: historyHash, 
+        backStack: function() { return backStack; }, 
+        forwardStack: function() { return forwardStack }, 
+        getPlayer: getPlayer, 
+        initialize: function(src) {
+            _initialize(src);
+        }, 
+        setURL: function(url) {
+            document.location.href = url;
+        }, 
+        getURL: function() {
+            return document.location.href;
+        }, 
+        getTitle: function() {
+            return document.title;
+        }, 
+        setTitle: function(title) {
+            try {
+                backStack[backStack.length - 1].title = title;
+            } catch(e) { }
+            //if on safari, set the title to be the empty string. 
+            if (browser.safari) {
+                if (title == "") {
+                    try {
+                    var tmp = window.location.href.toString();
+                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
+                    } catch(e) {
+                        title = "";
+                    }
+                }
+            }
+            document.title = title;
+        }, 
+        setDefaultURL: function(def)
+        {
+            defaultHash = def;
+            def = getHash();
+            //trailing ? is important else an extra frame gets added to the history
+            //when navigating back to the first page.  Alternatively could check
+            //in history frame navigation to compare # and ?.
+            if (browser.ie)
+            {
+                window['_ie_firstload'] = true;
+                var sourceToSet = historyFrameSourcePrefix + def;
+                var func = function() {
+                    getHistoryFrame().src = sourceToSet;
+                    window.location.replace("#" + def);
+                    setInterval(checkForUrlChange, 50);
+                }
+                try {
+                    func();
+                } catch(e) {
+                    window.setTimeout(function() { func(); }, 0);
+                }
+            }
+
+            if (browser.safari)
+            {
+                currentHistoryLength = history.length;
+                if (historyHash.length == 0) {
+                    historyHash[currentHistoryLength] = def;
+                    var newloc = "#" + def;
+                    window.location.replace(newloc);
+                } else {
+                    //alert(historyHash[historyHash.length-1]);
+                }
+                //setHash(def);
+                setInterval(checkForUrlChange, 50);
+            }
+            
+            
+            if (browser.firefox || browser.opera)
+            {
+                var reg = new RegExp("#" + def + "$");
+                if (window.location.toString().match(reg)) {
+                } else {
+                    var newloc ="#" + def;
+                    window.location.replace(newloc);
+                }
+                setInterval(checkForUrlChange, 50);
+                //setHash(def);
+            }
+
+        }, 
+
+        /* Set the current browser URL; called from inside BrowserManager to propagate
+         * the application state out to the container.
+         */
+        setBrowserURL: function(flexAppUrl, objectId) {
+            if (browser.ie && typeof objectId != "undefined") {
+                currentObjectId = objectId;
+            }
+           //fromIframe = fromIframe || false;
+           //fromFlex = fromFlex || false;
+           //alert("setBrowserURL: " + flexAppUrl);
+           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
+
+           var pos = document.location.href.indexOf('#');
+           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
+           var newUrl = baseUrl + '#' + flexAppUrl;
+
+           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
+               currentHref = newUrl;
+               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
+               currentHistoryLength = history.length;
+           }
+
+           return false;
+        }, 
+
+        browserURLChange: function(flexAppUrl) {
+            var objectId = null;
+            if (browser.ie && currentObjectId != null) {
+                objectId = currentObjectId;
+            }
+            pendingURL = '';
+            
+            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
+                var pl = getPlayers();
+                for (var i = 0; i < pl.length; i++) {
+                    try {
+                        pl[i].browserURLChange(flexAppUrl);
+                    } catch(e) { }
+                }
+            } else {
+                try {
+                    getPlayer(objectId).browserURLChange(flexAppUrl);
+                } catch(e) { }
+            }
+
+            currentObjectId = null;
+        }
+
+    }
+
+})();
+
+// Initialization
+
+// Automated unit testing and other diagnostics
+
+function setURL(url)
+{
+    document.location.href = url;
+}
+
+function backButton()
+{
+    history.back();
+}
+
+function forwardButton()
+{
+    history.forward();
+}
+
+function goForwardOrBackInHistory(step)
+{
+    history.go(step);
+}
+
+//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
+(function(i) {
+    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
+    var st = setTimeout;
+    if(/webkit/i.test(u)){
+        st(function(){
+            var dr=document.readyState;
+            if(dr=="loaded"||dr=="complete"){i()}
+            else{st(arguments.callee,10);}},10);
+    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
+        document.addEventListener("DOMContentLoaded",i,false);
+    } else if(e){
+    (function(){
+        var t=document.createElement('doc:rdy');
+        try{t.doScroll('left');
+            i();t=null;
+        }catch(e){st(arguments.callee,0);}})();
+    } else{
+        window.onload=i;
+    }
+})( function() {BrowserHistory.initialize();} );
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/html-template/history/historyFrame.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/html-template/history/historyFrame.html	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,29 @@
+<html>
+    <head>
+        <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
+        <META HTTP-EQUIV="Expires" CONTENT="-1"> 
+    </head>
+    <body>
+    <script>
+        function processUrl()
+        {
+
+            var pos = url.indexOf("?");
+            url = pos != -1 ? url.substr(pos + 1) : "";
+            if (!parent._ie_firstload) {
+                parent.BrowserHistory.setBrowserURL(url);
+                try {
+                    parent.BrowserHistory.browserURLChange(url);
+                } catch(e) { }
+            } else {
+                parent._ie_firstload = false;
+            }
+        }
+
+        var url = document.location.href;
+        processUrl();
+        document.write(encodeURIComponent(url));
+    </script>
+    Hidden frame for Browser History support.
+    </body>
+</html>
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/html-template/index.template.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/html-template/index.template.html	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,121 @@
+<!-- saved from url=(0014)about:internet -->
+<html lang="en">
+
+<!-- 
+Smart developers always View Source. 
+
+This application was built using Adobe Flex, an open source framework
+for building rich Internet applications that get delivered via the
+Flash Player or to desktops via Adobe AIR. 
+
+Learn more about Flex at http://flex.org 
+// -->
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<!--  BEGIN Browser History required section -->
+<link rel="stylesheet" type="text/css" href="history/history.css" />
+<!--  END Browser History required section -->
+
+<title>${title}</title>
+<script src="AC_OETags.js" language="javascript"></script>
+
+<!--  BEGIN Browser History required section -->
+<script src="history/history.js" language="javascript"></script>
+<!--  END Browser History required section -->
+
+<style>
+body { margin: 0px; overflow:hidden }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = ${version_major};
+// Minor version of Flash required
+var requiredMinorVersion = ${version_minor};
+// Minor version of Flash required
+var requiredRevision = ${version_revision};
+// -----------------------------------------------------------------------------
+// -->
+</script>
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+if ( hasProductInstall && !hasRequestedVersion ) {
+	// DO NOT MODIFY THE FOLLOWING FOUR LINES
+	// Location visited after installation is complete if installation is required
+	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+	var MMredirectURL = window.location;
+    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+    var MMdoctitle = document.title;
+
+	AC_FL_RunContent(
+		"src", "playerProductInstall",
+		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+		"width", "${width}",
+		"height", "${height}",
+		"align", "middle",
+		"id", "${application}",
+		"quality", "high",
+		"bgcolor", "${bgcolor}",
+		"name", "${application}",
+		"allowScriptAccess","sameDomain",
+		"type", "application/x-shockwave-flash",
+		"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+} else if (hasRequestedVersion) {
+	// if we've detected an acceptable version
+	// embed the Flash Content SWF when all tests are passed
+	AC_FL_RunContent(
+			"src", "${swf}",
+			"width", "${width}",
+			"height", "${height}",
+			"align", "middle",
+			"id", "${application}",
+			"quality", "high",
+			"bgcolor", "${bgcolor}",
+			"name", "${application}",
+			"allowScriptAccess","sameDomain",
+			"type", "application/x-shockwave-flash",
+			"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+  } else {  // flash is too old or we can't detect the plugin
+    var alternateContent = 'Alternate HTML content should be placed here. '
+  	+ 'This content requires the Adobe Flash Player. '
+   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+    document.write(alternateContent);  // insert non-flash content
+  }
+// -->
+</script>
+<noscript>
+  	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+			id="${application}" width="${width}" height="${height}"
+			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+			<param name="movie" value="${swf}.swf" />
+			<param name="quality" value="high" />
+			<param name="bgcolor" value="${bgcolor}" />
+			<param name="allowScriptAccess" value="sameDomain" />
+			<embed src="${swf}.swf" quality="high" bgcolor="${bgcolor}"
+				width="${width}" height="${height}" name="${application}" align="middle"
+				play="true"
+				loop="false"
+				quality="high"
+				allowScriptAccess="sameDomain"
+				type="application/x-shockwave-flash"
+				pluginspage="http://www.adobe.com/go/getflashplayer">
+			</embed>
+	</object>
+</noscript>
+</body>
+</html>
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/src/TestConfiguration.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/TestConfiguration.as	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,35 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package
+{
+    
+    /** 
+     * TestConfiguration is a static helper class that
+     * returns the array of test suites to execute
+     */
+    
+    public class TestConfiguration
+    {
+        
+        public static function suites() : Array
+        {
+            var suiteArray:Array = new Array();
+    
+            suiteArray.push( new TestSuite1() );
+            //suiteArray.push( new ControllerTestSuite() );
+            
+            return suiteArray;
+        }
+    }
+}
\ No newline at end of file
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/src/TestRunnerModules.mxml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/TestRunnerModules.mxml	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+-->
+
+<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" implements="net.digitalprimates.fluint.modules.ITestSuiteModule">
+    <mx:Script>
+    <![CDATA[
+    import net.digitalprimates.fluint.unitTests.frameworkSuite.FrameworkSuite;
+    public function getTestSuites():Array {
+        return TestConfiguration.suites()
+    }
+    ]]>
+    </mx:Script>    
+</mx:Module>
\ No newline at end of file
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/src/TestSuite1.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/TestSuite1.as	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,29 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package
+{
+    
+    import net.digitalprimates.fluint.tests.TestSuite;
+    
+    import tests.TestBasics;
+
+    public class TestSuite1 extends TestSuite
+    {
+        public function TestSuite1()
+        {
+            addTestCase( new TestBasics() );
+        }
+
+    }
+}
\ No newline at end of file
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/src/WebTestRunner.mxml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/WebTestRunner.mxml	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+-->
+
+<mx:Application
+    xmlns:mx="http://www.adobe.com/2006/mxml" 
+    xmlns:fluint="http://www.digitalprimates.net/2008/fluint"
+    layout="absolute"
+    creationComplete="startTestProcess(event)"
+    width="100%" height="100%"
+    >
+
+    <mx:Script>
+    <![CDATA[
+
+    protected function startTestProcess( event:Event ):void 
+    {
+        // run RAF tests here too since lib projects can't have a web test runner
+        var suites:Array = TestConfiguration.suites();
+        testRunner.startTests(suites);
+    }
+
+    ]]>
+    </mx:Script>
+
+    <fluint:TestResultDisplay width="100%" height="100%"/>
+
+    <fluint:TestRunner id="testRunner"/>
+
+</mx:Application>
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/src/tests/TestBase.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/TestBase.as	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,75 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests
+{
+    import flash.xml.XMLNode;
+    
+    import net.digitalprimates.fluint.tests.TestCase;
+
+    public class TestBase extends TestCase
+    {
+        // NOTE: we don't really need an empty constructor
+        // here for example purposes
+        public function TestBase()
+        {
+            super();
+        }
+
+        public var testData:TestData;
+        
+        // here for example purposes
+        override protected function setUp():void
+        {
+            testData = new TestData();
+        }
+        
+        // here for example purposes
+        override protected function tearDown():void
+        {
+            
+        }
+        
+        public function compareXML(a:XMLNode, b:XMLNode):Boolean
+        {
+            var aString:String = a.toString();
+            var bString:String = b.toString();
+            var outputXML:XML = new XML(aString);
+            var inputXML:XML = new XML(bString);
+            
+            var xmlInputString:String = inputXML.toXMLString();
+            var xmlOutputString:String = outputXML.toXMLString();
+            
+            return (xmlOutputString == xmlInputString);
+        }
+
+
+        public function compareXMLtoString(a:XMLNode, b:String):Boolean
+        {
+            var outputXML:XML = new XML(a.toString());
+            var inputXML:XML = new XML(b);
+            
+            var xmlInputString:String = inputXML.toXMLString();
+            var xmlOutputString:String = outputXML.toXMLString();
+            
+            return (xmlOutputString == xmlInputString);
+        }
+        
+        // helper functions here to compare input XML to output XML
+        // helper functions to take an object to XML
+        // helper function to take XML to an object
+        
+        // helper functions to compare one object to another
+        
+    }
+}
\ No newline at end of file
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/src/tests/TestBasics.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/TestBasics.as	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,191 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests
+{
+import com.rpath.xobj.*;
+
+import tests.models.*;
+
+import flash.xml.XMLDocument;
+
+
+public class TestBasics extends TestBase
+{
+    /** testSimple 
+    * test basic decoding behavior of a simple XML document
+    */
+    public function testSimple():void
+    {
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder();
+        var xmlInput:XMLDocument = new XMLDocument(testData.simple);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+        
+        assertTrue(o.top is Object);
+        assertTrue(o.top.attr1 == "anattr");
+        assertTrue(o.top.attr2 == "another");
+        assertTrue(o.top.prop == "something");
+        assertTrue(o.top.subelement.subattr == "2");
+        assertTrue(o.top.subelement is XObjString);
+    }
+    
+    /** testComplex
+    * Slightly more complex test with a repeated element that results in an
+    * Array property
+    */
+    public function testComplex():void
+    {
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder();
+        var xmlInput:XMLDocument = new XMLDocument(testData.complex);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+        
+        assertTrue(o.top is Object);
+        assertTrue(o.top.prop.subprop is Array);
+        
+        // check array content
+        for (var i:int=0; i<o.top.prop.subprop.length; i++)
+        {
+            assertTrue(o.top.prop.subprop[i] is XObjString);
+            assertTrue(o.top.prop.subprop[i] == ['asdf', 'fdsa'][i]);
+        }
+        
+        var typedEncoder:XObjXMLEncoder = new XObjXMLEncoder();
+        var xmlOutput:XMLDocument = typedEncoder.encodeObject(o);
+
+        assertTrue("encode matches input", compareXML(xmlOutput, xmlInput));
+    }        
+
+    /** testNamespaces
+    * test namespaces and prefixes are correctly mapped to properties on decode
+    * and that they are correctly mapped back to prefixed tags on encode. 
+    * Also check that encoding is symmetrical with decoding.
+    * This particular test case has an element tag that defines the namespace
+    * that itself is declared within - a specific edge case.
+    */
+    public function testNamespaces():void
+    {
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder();
+        var xmlInput:XMLDocument = new XMLDocument(testData.namespaces);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+
+        assertTrue(o.top.other_tag.other_val == '1')
+        assertTrue(o.top.other2_tag.val == '2')
+        
+        var typedEncoder:XObjXMLEncoder = new XObjXMLEncoder();
+        var xmlOutput:XMLDocument = typedEncoder.encodeObject(o);
+
+        assertTrue("encode matches input", compareXML(xmlOutput, xmlInput));
+    } 
+
+    /** testMappedNamespaces
+    * test that we can specify a local prefix other3 for a given namespace
+    * allowing us to write code that is insulated from the arbitrary prefixes
+    * a given document might choose.
+    */
+    public function testMappedNamespaces():void
+    {
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder(null, { other3 : 'http://other/other2'});
+        var xmlInput:XMLDocument = new XMLDocument(testData.namespaces);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+
+        assertTrue(o.top.other_tag.other_val == '1')
+        assertTrue(o.top.other3_tag.val == '2')
+        
+        var typedEncoder:XObjXMLEncoder = new XObjXMLEncoder();
+        var xmlOutput:XMLDocument = typedEncoder.encodeObject(o);
+
+        // check that we remap to original prefixes on the way back out
+        assertTrue("encode matches input", compareXML(xmlOutput, xmlInput));
+    } 
+
+    /** testExplicitNamespace
+    * test that when a namespace is redundantly declared as both default and
+    * by prefix in the XML, that the result is strictly prefixed on output
+    * This is to ensure documents conformant to an XMLSchema that uses
+    * attributeFormDefault = qualified and elementFormDefault = qualified
+    * are encoded correctly for the schema.
+    * 
+    * Note that we *always* do this, since an unqualified schema requirement
+    * will be satisified by a qualified XML document.
+    */
+    public function testExplicitNamespace():void
+    {
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder();
+        var xmlInput:XMLDocument = new XMLDocument(testData.explicitns);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+
+        assertTrue(o.ns_top.ns_element.ns_attr == 'foo')
+        
+        var typedEncoder:XObjXMLEncoder = new XObjXMLEncoder();
+        var xmlOutput:XMLDocument = typedEncoder.encodeObject(o);
+
+        var expectedString:String = 
+                '<ns:top xmlns:ns="http://somens.xsd">\n' + 
+                '  <ns:element ns:attr="foo"/>\n' + 
+                '</ns:top>\n';
+
+        // check that we remap to original prefixes on the way back out
+        assertTrue("encode is fully qualified", compareXMLtoString(xmlOutput, expectedString));
+    }
+
+
+    /** testObjectTree
+    * test that we can construct a new object graph and encode it as XML.
+    * test that we can then decode it and get back a new graph with correctly
+    * typed ActionScript objects.
+    */
+    public function testObjectTree():void
+    {
+        var t:Top = new Top();
+        t.prop = 'abc';
+        t.middle = new Middle();
+        t.middle.tag = 123;
+
+        var typeMap:* = {top:Top};
+        
+        var typedEncoder:XObjXMLEncoder = new XObjXMLEncoder(typeMap);
+        var xmlOutput:XMLDocument = typedEncoder.encodeObject(t);
+
+        var expectedString:String = 
+                '<top>\n'+
+                '  <middle>\n'+
+                '    <tag>123</tag>\n'+
+                '  </middle>\n'+
+                '  <prop>abc</prop>\n'+
+                '</top>\n';
+        
+        assertTrue(compareXMLtoString(xmlOutput, expectedString));
+
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder(typeMap);
+        var xmlInput:XMLDocument = xmlOutput;
+        var o:* = typedDecoder.decodeXML(xmlInput);
+
+        assertTrue(o.top is Top);
+        assertTrue(o.top.middle is Middle);
+        assertTrue(o.top.middle.tag == 123);
+        assertTrue(o.top.middle.foo() == 123);
+
+        // reencode and check round-trip
+        xmlOutput = typedEncoder.encodeObject(o);
+
+        assertTrue("encode matches input", compareXML(xmlOutput, xmlInput));
+
+    }
+
+    public function testId():void
+    {
+    }
+
+}
+}
+
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/src/tests/TestData.mxml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/TestData.mxml	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,23 @@
+<!--
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+-->
+
+<mx:Object xmlns:mx="http://www.adobe.com/2006/mxml">
+    
+    <mx:XML id="explicitns" source="../../test/explicitns.xml" />
+    <mx:XML id="id1" source="../../test/id1.xml" />
+    <mx:XML id="id2" source="../../test/id2.xml" />
+    <mx:XML id="namespaces" source="../../test/namespaces.xml" />
+    <mx:XML id="simple" source="../../test/simple.xml" />
+    <mx:XML id="complex" source="../../test/complex.xml" />
+        
+</mx:Object>
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/src/tests/models/Middle.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/models/Middle.as	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,26 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests.models
+{
+    public class Middle
+    {
+        public function Middle()
+        {
+        }
+
+    public var tag:int;
+    public function foo():int { return tag  }
+
+    }
+}
\ No newline at end of file
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/src/tests/models/Top.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/models/Top.as	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,24 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests.models
+{
+    public dynamic class Top
+    {
+        public function Top()
+        {
+        }
+
+        public var middle:Middle;
+    }
+}
\ No newline at end of file
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3-test/test
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/test	Fri Dec 19 22:52:39 2008 -0500
@@ -0,0 +1,1 @@
+../../test
\ No newline at end of file
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3/src/com/rpath/xobj/SchemaAwareXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/SchemaAwareXMLDecoder.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/SchemaAwareXMLDecoder.as	Fri Dec 19 22:52:39 2008 -0500
@@ -1,3 +1,16 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
 package com.rpath.xobj
 {
     import mx.rpc.xml.XMLDecoder;
@@ -19,7 +32,7 @@
         /**
          * We need to override this due to a bug in XMLDecoder's handling of
          * the anyAttribute schema type when used at the end of a type decl
-         * to allowfor additional arbitrary attributes. The effect is to 
+         * to allow for additional arbitrary attributes. The effect is to 
          * duplicate any defined attrs by failing to observe that they've already
          * been processed.
          * 
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as	Fri Dec 19 22:52:39 2008 -0500
@@ -1,3 +1,16 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
 package com.rpath.xobj
 {
     
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3/src/com/rpath/xobj/XObjQName.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjQName.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjQName.as	Fri Dec 19 22:52:39 2008 -0500
@@ -1,3 +1,16 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
 package com.rpath.xobj
 {
     [RemoteClass]   // tell the compiler we can be deep copied  
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3/src/com/rpath/xobj/XObjString.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjString.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjString.as	Fri Dec 19 22:52:39 2008 -0500
@@ -1,3 +1,16 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
 package com.rpath.xobj
 {
     import flash.net.registerClassAlias;
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Fri Dec 19 22:52:39 2008 -0500
@@ -1,3 +1,16 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
 package com.rpath.xobj
 {
     import flash.utils.getDefinitionByName;
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Fri Dec 19 22:52:39 2008 -0500
@@ -330,12 +330,14 @@
                 for (var i:uint = 0; i < children.length; i++)
                 {
                     var partNode:XMLNode = children[i];
-                    var partQName:XObjQName = new XObjQName(partNode.namespaceURI, partNode.nodeName);
+                    
                     // skip text nodes, which are part of mixed content
                     if (partNode.nodeType != XMLNodeType.ELEMENT_NODE)
                     {
                         continue;
                     }
+
+                    var partQName:XObjQName = new XObjQName(partNode.namespaceURI, XObjUtils.getNCName(partNode.nodeName));
 
                     // record the order we see the elements in for encoding purposes
                     // this is an attempt to "fake" XMLSchema sequence constraint of
@@ -348,7 +350,7 @@
                     }
                     
                     // TODO: allow type map entries to be full QNames, not just local names
-                    var partName:* = decodePartName(partQName, dataNode);
+                    var partName:* = decodePartName(partQName, partNode);
                     lastPartName.propname = partName;
                     
                     var partTypeName:String = XObjUtils.typeNameForProperty(resultTypeName, partName);
@@ -511,6 +513,8 @@
             for (var p:String in result)
             {
                 count++;
+                if (count > 1)
+                    break;
             }
             
             if (count == 1)
diff -r 87487951f258 -r 703a09ec1a1d as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as	Fri Dec 19 14:23:44 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as	Fri Dec 19 22:52:39 2008 -0500
@@ -33,7 +33,6 @@
 import flash.utils.*;
 import flash.xml.XMLDocument;
 import flash.xml.XMLNode;
-import flash.xml.XMLNodeType;
 
 import mx.utils.*;
 
@@ -135,10 +134,16 @@
     //--------------------------------------------------------------------------
     
 
-    public function XObjXMLEncoder(typeMap:*, nmMap: *, myXML:XMLDocument=null)
+    public function XObjXMLEncoder(typeMap:*=null, nmMap: *=null, myXML:XMLDocument=null)
     {
         super();
-
+        
+        if (typeMap == null)
+            typeMap = {};
+        
+        if (nmMap == null)
+            nmMap = {};
+            
         this.typeMap = typeMap;
 
         for (var prefix:String in nmMap)
@@ -147,7 +152,7 @@
             spacenameMap[prefix] = nmMap[prefix];
         }
         
-        this.myXMLDoc = myXML ? myXML : new XMLDocument();
+        this.xmlDocument = myXML ? myXML : new XMLDocument();
     }
 
     //--------------------------------------------------------------------------
@@ -156,7 +161,7 @@
     //
     //--------------------------------------------------------------------------
     
-    protected var myXMLDoc:XMLDocument;
+    public var xmlDocument:XMLDocument;
     
     //--------------------------------------------------------------------------
     //
@@ -176,25 +181,66 @@
      * value.
      */
 
-    public function encodeObject(obj:Object, parentNode:XMLNode=null):XMLNode
+    public function encodeObject(obj:Object, parentNode:XMLNode=null):XMLDocument
     {
+        var qname:XObjQName;
+        
+        // is obj a root holder?
+        if (XObjMetadata.METADATA_PROPERTY in obj)
+        {
+            var xobj:XObjMetadata = obj[XObjMetadata.METADATA_PROPERTY];
+            if (xobj.elements.length == 1)
+            {
+                obj = obj[xobj.elements[0].propname];
+                qname = xobj.elements[0].qname;
+            }
+        }
+        
         // we want to make sure the type we use for root node is type of object
         var tag:String = tagForType(obj);
         
         // handle untyped objects
-        if(!tag)
+        if (!tag)
         {
             tag = defaultTag;
         }
         
-        if (!parentNode)
-            parentNode = new XMLNode(XMLNodeType.ELEMENT_NODE, tag);
-            
-        return encodeValue(obj, new XObjQName("",tag), parentNode);
+        if (qname == null)
+            qname = new XObjQName("", tag);
+        
+        // null parentNode means "make a new document please"
+        if (parentNode == null)
+        {
+            xmlDocument = new XMLDocument();
+            parentNode = xmlDocument;
+        }
+        else if (parentNode != xmlDocument)
+        {
+            parentNode.parentNode = xmlDocument;
+        }
+        
+        encodeValue(obj, qname, parentNode);
+        
+        return xmlDocument;
     }
 
-    public function encodeValue(obj:Object, qname:XObjQName, parentNode:XMLNode):XMLNode
+    public function encodeValue(obj:Object, q:*, parentNode:XMLNode):XMLNode
     {
+        var qname:XObjQName = new XObjQName();;
+        
+        if (q is XObjQName)
+            qname = q;
+        else if (q is QName)
+        {
+            qname.localName = (q as QName).localName;
+            qname.uri = (q as QName).uri;
+        }
+        else if (q is String)
+        {
+            qname.localName == q;
+            qname.uri="";
+        }
+            
         if (qname.localName == null || qname.localName == "")
             trace("missing qname");
         
@@ -202,9 +248,9 @@
         // TODO: check whether this matches Erik's server-side Python mapping
         if (obj == null)
         {
-            var myElement:XMLNode = myXMLDoc.createElement("foo");
+            var myElement:XMLNode = xmlDocument.createElement("foo");
+            parentNode.appendChild(myElement);
             myElement.nodeName = XObjUtils.encodeElementTag(qname, parentNode);
-            parentNode.appendChild(myElement);
             return myElement;
         }
         else if (qname.localName == XObjMetadata.METADATA_PROPERTY)
@@ -224,6 +270,8 @@
             var newNode:XMLNode = encodeValue(obj.value, qname, parentNode);
             // encoded as meta ?
             setAttributes(newNode, obj);
+            // re-encode the nodename to pick up possible local namespace overrides
+            newNode.nodeName = XObjUtils.encodeElementTag(qname, newNode);
             return newNode;
         }
         else
@@ -249,7 +297,7 @@
             return myElement;
         }
     
-        myElement = myXMLDoc.createElement("foo");
+        myElement = xmlDocument.createElement("foo");
         
         if (typeType == XObjXMLEncoder.OBJECT_TYPE)
         {
@@ -384,7 +432,7 @@
                 valueString = obj.toString();
             }
     
-            var valueNode:XMLNode = myXMLDoc.createTextNode(valueString);
+            var valueNode:XMLNode = xmlDocument.createTextNode(valueString);
             myElement.appendChild(valueNode);
         }
     


From bpja@rpath.com Sat Dec 20 17:42:01 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBKHg0fS032200
	for <xobj-commits@lists.rpath.com>; Sat, 20 Dec 2008 17:42:00 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBKHg0rT004209
	for <xobj-commits@lists.rpath.com>; Sat, 20 Dec 2008 12:42:00 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBKHg0Xl018007
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Sat, 20 Dec 2008 12:42:00 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBKHg0s8008229
	for <xobj-commits@lists.rpath.com>; Sat, 20 Dec 2008 12:42:00 -0500
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBKHfxiw008223
	for xobj-commits@lists.rpath.com; Sat, 20 Dec 2008 12:41:59 -0500
From: Brett Adam <bpja@rpath.com>
Message-Id: <200812201741.mBKHfxiw008223@scc.eng.rpath.com>
Date: Sat, 20 Dec 2008 12:41:59 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Fix handling of <empty/> elements
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Sat, 20 Dec 2008 17:42:01 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3-test/src/tests/TestBasics.as as3/xobjas3-test/src/tests/models/Top.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Fix handling of <empty/> elements

diff -r 1b34a0422291 -r 737ae34f3b8a as3/xobjas3-test/src/tests/TestBasics.as
--- a/as3/xobjas3-test/src/tests/TestBasics.as	Fri Dec 19 22:58:26 2008 -0500
+++ b/as3/xobjas3-test/src/tests/TestBasics.as	Sat Dec 20 12:41:32 2008 -0500
@@ -150,7 +150,7 @@
         t.prop = 'abc';
         t.middle = new Middle();
         t.middle.tag = 123;
-
+        t.bottom = null;
         var typeMap:* = {top:Top};
         
         var typedEncoder:XObjXMLEncoder = new XObjXMLEncoder(typeMap);
@@ -158,6 +158,7 @@
 
         var expectedString:String = 
                 '<top>\n'+
+                '  <bottom/>\n'+
                 '  <middle>\n'+
                 '    <tag>123</tag>\n'+
                 '  </middle>\n'+
@@ -174,6 +175,7 @@
         assertTrue(o.top.middle is Middle);
         assertTrue(o.top.middle.tag == 123);
         assertTrue(o.top.middle.foo() == 123);
+        assertTrue(o.top.bottom == null);
 
         // reencode and check round-trip
         xmlOutput = typedEncoder.encodeObject(o);
diff -r 1b34a0422291 -r 737ae34f3b8a as3/xobjas3-test/src/tests/models/Top.as
--- a/as3/xobjas3-test/src/tests/models/Top.as	Fri Dec 19 22:58:26 2008 -0500
+++ b/as3/xobjas3-test/src/tests/models/Top.as	Sat Dec 20 12:41:32 2008 -0500
@@ -20,5 +20,6 @@
         }
 
         public var middle:Middle;
+        public var bottom:Middle;
     }
 }
\ No newline at end of file
diff -r 1b34a0422291 -r 737ae34f3b8a as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Fri Dec 19 22:58:26 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Sat Dec 20 12:41:32 2008 -0500
@@ -212,6 +212,7 @@
     public function decodeXML(dataNode:XMLNode, propType:Class = null):Object
     {
         var result:*;
+        var nullObject:Boolean;
         var isSimpleType:Boolean = false;
         var shouldMakeBindable:Boolean = false;
         var isTypedProperty:Boolean = false;
@@ -294,6 +295,9 @@
         
         result = new resultType();
         
+        // track whether we actually have any values at all
+        nullObject = true;
+        
         // so what type did we eventually use?
         var resultTypeName:String = getQualifiedClassName(result);
         
@@ -309,6 +313,7 @@
         
         if ((children.length == 1) && (children[0].nodeType == XMLNodeType.TEXT_NODE))
         {
+            nullObject = false;
             // If exactly one text node subtype, we must want a simple
             // value.
             
@@ -323,6 +328,7 @@
         {
             if (children.length > 0)
             {
+                nullObject = false;
                 var seenProperties:Object = {};
                 var lastPartName:Object = {qname: null, propname: null};
                 
@@ -455,6 +461,7 @@
         for (var attribute:String in attributes)
         {
             
+            nullObject = false;
             // result can be null if it contains no children.
             if (result == null)
             {
@@ -532,6 +539,10 @@
         if (elementSet.length > 0)
             XObjMetadata.setElements(result, elementSet);
         
+        // so did we actually do anything to the object?
+        if (nullObject)
+            result = null;
+            
         return result;
     }
 

From bpja@rpath.com Tue Dec 23 05:03:06 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBN536Ku019916
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 05:03:06 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBN535VU031337
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 00:03:06 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBN5343S007402
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 00:03:04 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBN534IC029989
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 00:03:04 -0500
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBN534Op029984
	for xobj-commits@lists.rpath.com; Tue, 23 Dec 2008 00:03:04 -0500
From: Brett Adam <bpja@rpath.com>
Message-Id: <200812230503.mBN534Op029984@scc.eng.rpath.com>
Date: Tue, 23 Dec 2008 00:03:04 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Cleanup old cruft in handling of Array types. Introduce
	support for [ArrayElementType()] metadata marker
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 23 Dec 2008 05:03:06 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjQName.as as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Cleanup old cruft in handling of Array types. Introduce support for [ArrayElementType()] metadata marker

diff -r 737ae34f3b8a -r 973c612929c3 as3/xobjas3/src/com/rpath/xobj/XObjQName.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjQName.as	Sat Dec 20 12:41:32 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjQName.as	Tue Dec 23 00:00:48 2008 -0500
@@ -26,5 +26,15 @@
         
         public var uri:String;
         
+        public static function equal(a: XObjQName, b:XObjQName):Boolean
+        {
+            if (a == null || b == null)
+                return false;
+            
+            if ((a.uri == b.uri) && (a.localName == b.localName))
+                return true;
+            
+            return false;
+        }
     }
 }
\ No newline at end of file
diff -r 737ae34f3b8a -r 973c612929c3 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Sat Dec 20 12:41:32 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Tue Dec 23 00:00:48 2008 -0500
@@ -16,6 +16,7 @@
     import flash.utils.getDefinitionByName;
     import flash.xml.XMLNode;
     
+    import mx.collections.ArrayCollection;
     import mx.utils.DescribeTypeCache;
 
     
@@ -82,56 +83,89 @@
      
     private static var typePropertyCache:Object = {};
 
-    public static function isTypeArray(typeName:String):Boolean
+    public static function isTypeArray(type:Class):Boolean
     {
-        // TODO: figure out how to generically detect a collection subtype
-        return (typeName == "Array");
+        if (type == null)
+            return false;
+        
+        var foo:* = new type();
+        return (foo is Array);
     }
 
-    public static function isTypeArrayCollection(typeName:String):Boolean
+    public static function isTypeArrayCollection(type:Class):Boolean
     {
-        // TODO: figure out how to generically detect a collection subtype
-        return (typeName == "mx.collections::ArrayCollection");
+        if (type == null)
+            return false;
+
+        var foo:* = new type();
+        return (type is ArrayCollection);
     }
     
-    public static function typeNameForProperty(className:String, propName:String):String
+    public static function typeInfoForProperty(className:String, propName:String):Object
     {
-        //var className:String = getQualifiedClassName(obj);
+        var isArray:Boolean = false;
+        var result:Object = {typeName: null, isArray: false, isArrayCollection: false};
         
         if (className == "Object" || className == "mx.utils::ObjectProxy")
-            return null;
+            return result;
         
-        var propertyClassName:String;
         var propertyCacheKey:String = className + "." + propName;
+        var arrayElementType:String;
         
-        propertyClassName = typePropertyCache[propertyCacheKey];
+        result = typePropertyCache[propertyCacheKey];
             
-        if (propertyClassName == null)
+        if (result == null)
         {
+            result = {typeName: null, isArray: false, isArrayCollection: false};
+            
             // go look it up (expensive)
             var typeDesc:* = DescribeTypeCache.describeType(className);
             var typeInfo:XML = typeDesc.typeDescription;
             
-            propertyClassName = typeInfo..accessor.(@name == propName).@type.toString().replace( /::/, "." );
-            if (propertyClassName == null || propertyClassName == "")
+            result.typeName = typeInfo..accessor.(@name == propName).@type.toString().replace( /::/, "." );
+            if (result.typeName == null || result.typeName == "")
             {    
-                propertyClassName = typeInfo..variable.(@name == propName).@type.toString().replace( /::/, "." );
+                result.typeName = typeInfo..variable.(@name == propName).@type.toString().replace( /::/, "." );
+                arrayElementType = typeInfo..variable.(@name == propName).metadata.(@name == 'ArrayElementType').arg.@value.toString().replace( /::/, "." );
+            }
+            else
+                arrayElementType = typeInfo..accessor.(@name == propName).metadata.(@name == 'ArrayElementType').arg.@value.toString().replace( /::/, "." );
+            
+            if (result.typeName == "Array")
+            {
+                result.isArray = true;
+                result.typeName = null; // assume generic object unless told otherwise
+            }
+            else if (result.typeName == "ArrayCollection")
+            {
+                result.isArrayCollection = true;
+                result.typeName = null; // assume generic object unless told otherwise
             }
             
-            if (propertyClassName == null || propertyClassName == "")
-                propertyClassName = "Undefined";
+            if (arrayElementType != "")
+            {
+                // use type specified
+                result.typeName = arrayElementType;
+            }
             
-                
+            if (result.typeName == "Object"
+                || result.typeName == "mx.utils::ObjectProxy"
+                || result.typeName == "Undefined"
+                || result.typeName == "*"
+                || result.typeName == "")
+            {
+                result.typeName = null;
+            }
+                 
             // cache the result for next time
-            typePropertyCache[propertyCacheKey] = propertyClassName;
+            typePropertyCache[propertyCacheKey] = result;
         }
         
-        if (propertyClassName == "Object" || propertyClassName == "mx.utils::ObjectProxy")
-            return null;
-            
-        return (propertyClassName != "Undefined") ? propertyClassName : null;
+       
+        return result;
     }
     
-    
+
+        
     }
 }
\ No newline at end of file
diff -r 737ae34f3b8a -r 973c612929c3 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Sat Dec 20 12:41:32 2008 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Tue Dec 23 00:00:48 2008 -0500
@@ -235,6 +235,14 @@
         Or it could be the element name maps to a type in the TypeMap
         
         */
+        
+        //TODO: make sure we don't obscure typeMap entries with
+        // generic Array or ArrayCollection requests
+        if (XObjUtils.isTypeArray(propType) || XObjUtils.isTypeArrayCollection(propType))
+        {
+            propType = nodeType;
+        }
+        
         isTypedProperty = (propType != null);
         
         var nodeType:Class = typeForTag(dataNode.nodeName);
@@ -304,13 +312,12 @@
         // thus, what type of assignment function should we use?
         var assign:Function;
         
-        if (XObjUtils.isTypeArray(resultTypeName))
+        if (XObjUtils.isTypeArray(resultType) || XObjUtils.isTypeArrayCollection(resultType))
             assign = assignToArray;
         else
             assign = assignToProperty;
 
         // OK. Now we're ready to decode some actual data!
-        
         if ((children.length == 1) && (children[0].nodeType == XMLNodeType.TEXT_NODE))
         {
             nullObject = false;
@@ -348,7 +355,7 @@
                     // record the order we see the elements in for encoding purposes
                     // this is an attempt to "fake" XMLSchema sequence constraint of
                     // ordered elements. Collapse sequenced repetitions to a single entry
-                    if (partQName != lastPartName.qname)
+                    if (!XObjQName.equal(partQName,lastPartName.qname))
                     {
                         lastPartName = {};
                         lastPartName.qname = partQName;
@@ -358,8 +365,12 @@
                     // TODO: allow type map entries to be full QNames, not just local names
                     var partName:* = decodePartName(partQName, partNode);
                     lastPartName.propname = partName;
-                    
-                    var partTypeName:String = XObjUtils.typeNameForProperty(resultTypeName, partName);
+                                        
+                    // what type do we want?
+                    var typeInfo:Object = XObjUtils.typeInfoForProperty(resultTypeName, partName);
+                    var partTypeName:String = typeInfo.typeName;
+                    var propertyIsArray:Boolean = typeInfo.isArray;
+                    var propertyIsArrayCollection:Boolean = typeInfo.isArrayCollection;
                     var partObj:*;
                     
                     if (partTypeName != null)
@@ -372,84 +383,14 @@
                     }
                     else
                         partObj = decodeXML(partNode);
-    
+                        
+                    // if we've seen this property before, assume it's an Array
                     if (seenProperties[partName])
                     {
-                           // Enable processing multiple copies of the same element (sequences)
-                        var existing:Object = result[partName];
+                        propertyIsArray = true;
                     }
                     
-                    if ((seenProperties[partName] && existing != null))
-                    {
-                        if (existing is Array)
-                        {
-                            existing.push(partObj);
-                        }
-                        else if (existing is ArrayCollection)
-                        {
-                            existing.source.push(partObj);
-                        }
-                        else
-                        {
-                            // make it an array
-                            if (existing)
-                                existing = [existing];
-                            else
-                                existing = [];
-                           
-                            existing.push(partObj);
-    
-                            if (shouldMakeBindable)
-                                existing = new ArrayCollection(existing as Array);
-    
-                            assign(result, partName, existing);
-                        }
-                    }
-                    // check the type of the property we're about to add, is it an array?
-                    else if (XObjUtils.isTypeArray(partTypeName))
-                    {
-                        if (partObj is Array)
-                            assign(result, partName, partObj);
-                        else if (partObj is ArrayCollection)
-                            assign(result, partName, partObj.source);
-                        else if (partObj is ObjectProxy)
-                        {
-                            partObj = partObj.item;
-                            // this is getting ugly
-                            if (partObj is Array)
-                                assign(result, partName, partObj);
-                            else if (partObj is ArrayCollection)
-                                assign(result, partName, partObj.source);
-                            else
-                                assign(result, partName, [partObj]);
-                        }
-                        else
-                            assign(result, partName, [partObj]);
-                    }
-                    else if (XObjUtils.isTypeArrayCollection(partTypeName))
-                    {
-                        if (partObj is Array)
-                            assign(result, partName, new ArrayCollection(partObj));
-                        else if (partObj is ArrayCollection)
-                            assign(result, partName, partObj);
-                        else if (partObj is ObjectProxy)
-                        {
-                            partObj = partObj.item;
-                            // this is getting ugly
-                            if (partObj is Array)
-                                assign(result, partName, new ArrayCollection(partObj));
-                            else if (partObj is ArrayCollection)
-                                assign(result, partName, partObj);
-                            else
-                                assign(result, partName, new ArrayCollection([partObj]));
-                        }
-                        else 
-                            assign(result, partName, new ArrayCollection([partObj]));
-                    }
-                    else
-                    {
-                        assign(result, partName, partObj);
-                    }
+                    assign(result, partName, partObj, propertyIsArray, propertyIsArrayCollection, shouldMakeBindable);
     
                     seenProperties[partName] = true;
                 }
@@ -547,16 +488,55 @@
     }
 
     import flash.utils.flash_proxy;
-    
-    private function assignToProperty(result:*, propName:String, value:*):void
+
+    private function assignToProperty(result:*, propName:String, value:*,
+        makeArray:Boolean, makeArrayCollection:Boolean, makeBindable:Boolean):void
     {
+        if (result == null)
+            return;
+        
+        if (makeArray || makeArrayCollection)
+        {
+            var existing:* = result[propName];
+            
+            if (existing == null)
+            {
+                existing = [];
+                existing = (existing as Array).concat(value);
+            }
+            else if (existing is Array)
+            {
+                existing = (existing as Array).concat(value);
+            }
+            else if (existing is ArrayCollection)
+            {
+                existing = (existing as ArrayCollection).source.concat(value);
+            }
+            else
+            {
+                existing = [existing];
+                existing = (existing as Array).concat(value);
+            }
+            
+            if ((makeArrayCollection || makeBindable) && !(existing is ArrayCollection))
+                existing = new ArrayCollection(existing as Array);
+                
+            value = existing;
+        }
+        
         result[propName] = value;
     }
     
-    private function assignToArray(result:*, propName:String, value:*):void
+    private function assignToArray(result:*, propName:String, value:*,
+        makeArray:Boolean, makeArrayCollection:Boolean, makeBindable:Boolean):void
     {
-        // propName is ignored in this case
-        result.push(value);
+        if (result == null)
+            return;
+        
+        if (result is Array)
+            result.push(value);
+        else if (result is ArrayCollection)
+            result.addItem(value);
     }
     
 

From ewt@rpath.com Tue Dec 23 21:30:56 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBNLUuRu004219
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 21:30:56 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBNLUuVe012457
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 16:30:56 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBNLUtFh009402
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 16:30:55 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBNLUtPO022119
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 16:30:55 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBNLUtow022114
	for xobj-commits@lists.rpath.com; Tue, 23 Dec 2008 16:30:55 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200812232130.mBNLUtow022114@scc.eng.rpath.com>
Date: Tue, 23 Dec 2008 16:30:54 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: XObject types are no longer required; we can marshall
	arbitrary types and
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 23 Dec 2008 21:30:56 -0000

tag:         tip
user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

XObject types are no longer required; we can marshall arbitrary types and
parse into any types (as long as we can add _xobj to those types). This
closely mirrors the as3 model
* * *
* * *

diff -r 973c612929c3 -r 4251ddd1989d py/test/xobjtest.py
--- a/py/test/xobjtest.py	Tue Dec 23 00:00:48 2008 -0500
+++ b/py/test/xobjtest.py	Tue Dec 23 16:21:50 2008 -0500
@@ -45,13 +45,18 @@
         self.assertEqual(o.top.subelement.subattr, '2')
         self.assertEqual(o.top.subelement.__class__.__name__,
                          'subelement_XObj_Type')
+        assert(repr(o.startswith('<xobj.xobj.Document object')))
+        assert(repr(o.top.startswith('<xobj.xobj.top_XObj_Type object')))
+        assert(repr(o.top.subelement).startswith(
+                                    '<xobj.xobj.subelement_XObj_Type object'))
+        self.assertEqual(repr(o.top.attr1), "'anattr'")
 
         # ---
 
-        class SubelementClass(xobj.XObject):
+        class SubelementClass(object):
             subattr = int
 
-        class TopClass(xobj.XObject):
+        class TopClass(object):
             subelement = SubelementClass
             unused = str
             attr1 = str
@@ -65,7 +70,7 @@
 
         # ---
 
-        class SubelementClass(xobj.XObject):
+        class SubelementClass(object):
             subattr = [ int ]
         TopClass.subelement = SubelementClass
         TopClass.prop = xobj.XObject
@@ -116,11 +121,11 @@
 
         # ---
 
-        class SubpropClass(xobj.XObject):
+        class SubpropClass(object):
             subattr = int
             unused = str
 
-        class PropClass(xobj.XObject):
+        class PropClass(object):
             subprop = [ SubpropClass ]
 
         class SimpleClass(xobj.XObject):
@@ -259,7 +264,7 @@
 
         # and test if the id isn't defined properly
         class Top(xobj.XObject):
-            _attributes = set(['ref'])
+            _xobj = xobj.XObjMetadata(attributes = [ 'ref' ])
             ref = xobj.XIDREF
         Document.top = Top
 
@@ -293,15 +298,15 @@
             )
         assert(s2 == expecteds2)
 
-    def testUnknownType(self):
-        s ='<top/>'
+    def testObjectType(self):
+        s ='<top attr="foo"/>'
         xml = StringIO(s)
 
         class Document(xobj.Document):
             top = object
 
-        self.assertRaises(xobj.UnknownXType, xobj.parsef, xml,
-                          documentClass = Document)
+        d = xobj.parsef(xml, documentClass = Document)
+        assert(d.top.attr == 'foo')
 
     def testTypeMap(self):
         s ='<top><item val="3"/></top>'
@@ -383,5 +388,26 @@
 
         d = xobj.parse(s)
 
+    def testCleanCreation(self):
+        class Top:
+            _xobj = xobj.XObjMetadata(
+                        elements = [ "first", "second", "third" ],
+                        attributes = [ "foo", "bar" ])
+
+        t = Top()
+        t.first = "1"
+        t.second = "2"
+        t.foo = "f"
+
+        self.assertEquals(xobj.toxml(t, 'top', xml_declaration = False),
+            '<top foo="f">\n'
+            '  <first>1</first>\n'
+            '  <second>2</second>\n'
+            '</top>\n')
+
+        t.unknown = "unknown"
+        assert("<unknown>unknown</unknown>" in
+                    xobj.toxml(t, 'top', xml_declaration = False))
+
 if __name__ == "__main__":
     testsuite.main()
diff -r 973c612929c3 -r 4251ddd1989d py/xobj/xobj.py
--- a/py/xobj/xobj.py	Tue Dec 23 00:00:48 2008 -0500
+++ b/py/xobj/xobj.py	Tue Dec 23 16:21:50 2008 -0500
@@ -45,24 +45,20 @@
 
 def XTypeFromXObjectType(xObjectType):
 
-    if (type(xObjectType) == type and
-            issubclass(xObjectType, XObject)):
-        return XType(xObjectType)
-    elif xObjectType == int:
-        return XType(XObjectInt)
-    elif xObjectType == str:
+    if xObjectType == str or xObjectType == object:
+        # Basic object's are static, making instantiating one pretty worthless.
         return XType(XObject)
     elif type(xObjectType) == list:
         assert(len(xObjectType) == 1)
         return XType(XTypeFromXObjectType(xObjectType[0]).pythonType,
                      forceList = True)
 
-    raise UnknownXType
+    return XType(xObjectType)
 
-class AbstractXObject(object):
+class XObject(str):
 
     """
-    Superclass for all elements represented in XML. Subclasses of XObject
+    Example class for all elements represented in XML. Subclasses of XObject
     can be used to specify how attributes and elements of the element are
     represented in python. For example, parsing the XML:
 
@@ -87,83 +83,28 @@
 
     """
 
-    _elements = []
-    _attributes = set()
-
-    def __init__(self, text = None):
-        self._elements = [ x for x in self._elements ]
-        self._attributes = set(x for x in self._attributes)
-
-    def _setAttribute(self, doc, key, val):
-        expectedType = getattr(self.__class__, key, None)
-        if expectedType is None:
-            expectedType = doc.typeMap.get(key, None)
-
-        if expectedType:
-            expectedXType = XTypeFromXObjectType(expectedType)
-            if (key == 'id' or key == 'xml_id' or
-                        issubclass(expectedXType.pythonType, XID)):
-                doc._ids[val] = self
-            elif issubclass(expectedXType.pythonType, XIDREF):
-                doc._idsNeeded.append((self, key, val))
-                return
-            else:
-                val = expectedXType.pythonType(val)
-        else:
-            if (key == 'id' or key == 'xml_id'):
-                doc._ids[val] = self
-
-            expectedXType = None
-            val = XObject(val)
-
-        self._addAttribute(key, val, xType = expectedXType)
-
-    def _addAttribute(self, key, val, xType = None):
-        if not self._attributes:
-            self._attributes = set([key])
-        elif key not in self._attributes:
-            self._attributes.add(key)
-
-        self._setItem(key, val, xType)
-
-    def _addElement(self, key, val, xType = None):
-        self._setItem(key, val, xType = xType)
-        if not self._elements:
-            self._elements = [ key ]
-        elif key not in self._elements:
-            self._elements.append(key)
-
-    def _setItem(self, key, val, xType = None):
-        current = getattr(self, key, None)
-        if xType and xType.forceList:
-            # force the item to be a list, and use the type inside of
-            # this list as the type of elements of the list
-            if key not in self.__dict__:
-                current = []
-                setattr(self, key, current)
-
-        if self.__dict__.get(key, None) is None:
-            # This has not yet been set in the instance (because it's missing)
-            # or it's been set to None (because we think we don't have this
-            # value but it's actually an idref being filled in later)
-            setattr(self, key, val)
-        elif type(current) == list:
-            current.append(val)
-        else:
-            setattr(self, key, [ current, val ])
-
-
-class XObjectInt(AbstractXObject, int):
-
-    pass
-
-class XObject(str, AbstractXObject):
-
     def __repr__(self):
         if self:
             return str.__repr__(self)
         else:
-            return AbstractXObject.__repr__(self)
+            return object.__repr__(self)
+
+class XObjMetadata(object):
+
+    __slots__ = [ 'elements', 'attributes', 'tag' ]
+
+    def __init__(self, elements = None, attributes = None):
+        if elements:
+            self.elements = list(elements)
+        else:
+            self.elements = []
+
+        if attributes:
+            self.attributes = set(attributes)
+        else:
+            self.attributes = set()
+
+        self.tag = None
 
 class XID(XObject):
 
@@ -184,6 +125,7 @@
         self._ids = {}
         self.__explicitNamespaces = False
         self.__xmlNsMap = {}
+        self._xobj = XObjMetadata()
 
     def getElementTree(self, xobj, tag, rootElement = None, nsmap = {}):
 
@@ -202,12 +144,15 @@
             element.text = xobj
             return element
 
-        if hasattr(xobj, '_tag'):
-            tag = xobj._tag
+        tag = addns(tag)
+
+        if hasattr(xobj, '_xobj'):
+            attrSet = xobj._xobj.attributes
+
+            if xobj._xobj.tag is not None:
+                tag = xobj._xobj.tag
         else:
-            tag = addns(tag)
-
-        attrSet = getattr(xobj, '_attributes', set())
+            attrSet = set()
 
         attrs = {}
         elements = {}
@@ -238,11 +183,11 @@
 
         orderedElements = []
 
-        if hasattr(xobj, '_elements'):
-            for name in xobj._elements:
-                for val in elements[name]:
+        if hasattr(xobj, '_xobj'):
+            for name in xobj._xobj.elements:
+                for val in elements.get(name, []):
                     orderedElements.append((name, val))
-            for name in (set(elements) - set(xobj._elements)):
+            for name in (set(elements) - set(xobj._xobj.elements)):
                 for val in elements[name]:
                     orderedElements.append((name, val))
         else:
@@ -302,6 +247,59 @@
                         s = s[len(long) + 2:]
 
             return s
+
+        def setAttribute(xobj, doc, key, val):
+            expectedType = getattr(xobj.__class__, key, None)
+            if expectedType is None:
+                expectedType = doc.typeMap.get(key, None)
+
+            if expectedType:
+                expectedXType = XTypeFromXObjectType(expectedType)
+                if (key == 'id' or key == 'xml_id' or
+                            issubclass(expectedXType.pythonType, XID)):
+                    doc._ids[val] = xobj
+                elif issubclass(expectedXType.pythonType, XIDREF):
+                    doc._idsNeeded.append((xobj, key, val))
+                    return
+                else:
+                    val = expectedXType.pythonType(val)
+            else:
+                if (key == 'id' or key == 'xml_id'):
+                    doc._ids[val] = xobj
+
+                expectedXType = None
+                val = XObject(val)
+
+            addAttribute(xobj, key, val, xType = expectedXType)
+
+        def addAttribute(xobj, key, val, xType = None):
+            setItem(xobj, key, val, xType)
+            xobj._xobj.attributes.add(key)
+
+        def addElement(xobj, key, val, xType = None):
+            setItem(xobj, key, val, xType = xType)
+            if key not in xobj._xobj.elements:
+                xobj._xobj.elements.append(key)
+
+        def setItem(xobj, key, val, xType = None):
+            current = getattr(xobj, key, None)
+            if xType and xType.forceList:
+                # force the item to be a list, and use the type inside of
+                # this list as the type of elements of the list
+                if key not in xobj.__dict__:
+                    current = []
+                    setattr(xobj, key, current)
+
+            if xobj.__dict__.get(key, None) is None:
+                # This has not yet been set in the instance (because it's
+                # missing) or it's been set to None (because we think we don't
+                # have this value but it's actually an idref being filled in
+                # later)
+                setattr(xobj, key, val)
+            elif type(current) == list:
+                current.append(val)
+            else:
+                setattr(xobj, key, [ current, val ])
 
         def parseElement(element, parentXType = None, parentXObj = None,
                          parentUnionTags = {}):
@@ -368,6 +366,9 @@
                 else:
                     xobj = NewClass()
 
+            if not hasattr(xobj, '_xobj'):
+                xobj._xobj = XObjMetadata()
+
             # handle children
             for childElement in element.getchildren():
                 if types.BuiltinFunctionType == type(childElement.tag):
@@ -380,7 +381,7 @@
             # handle attributes
             for (key, val) in element.items():
                 key = nsmap(key)
-                xobj._setAttribute(self, key, val)
+                setAttribute(xobj, self, key, val)
 
             # anything which is the same as in the class wasn't set in XML, so
             # set it to None
@@ -394,11 +395,11 @@
 
             if parentXObj is not None:
                 if tag in parentUnionTags:
-                    xobj._tag = tag
-                    parentXObj._addElement(parentUnionTags[tag][0], xobj,
+                    xobj._xobj.tag = tag
+                    addElement(parentXObj, parentUnionTags[tag][0], xobj,
                                            parentUnionTags[tag][1])
                 else:
-                    parentXObj._addElement(tag, xobj, thisXType)
+                    addElement(parentXObj, tag, xobj, thisXType)
 
             return xobj
 
@@ -425,7 +426,7 @@
         for (xobj, tag, theId) in self._idsNeeded:
             if theId not in self._ids:
                 raise XObjIdNotFound(theId)
-            xobj._addAttribute(tag, self._ids[theId])
+            addAttribute(xobj, tag, self._ids[theId])
 
 class XObjParseException(Exception):
 

From mtharp@rpath.com Tue Dec 23 22:49:56 2008
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id mBNMnupi005279
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 22:49:56 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id mBNMnt2N024180
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 17:49:56 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id mBNMntAK015939
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 17:49:55 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id mBNMntKI024027
	for <xobj-commits@lists.rpath.com>; Tue, 23 Dec 2008 17:49:55 -0500
Received: (from mtharp@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id mBNMntrA024022
	for xobj-commits@lists.rpath.com; Tue, 23 Dec 2008 22:49:55 GMT
From: Michael Tharp <mtharp@rpath.com>
Message-Id: <200812232249.mBNMntrA024022@scc.eng.rpath.com>
Date: Tue, 23 Dec 2008 22:49:55 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Initial set of makefiles for python
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 23 Dec 2008 22:49:56 -0000

tag:         tip
user:        Michael Tharp <mtharp@rpath.com>
files:       .hgignore LICENSE Make.defs Make.rules Makefile py/Makefile py/test/Makefile py/xobj/Makefile

Initial set of makefiles for python

diff -r 4251ddd1989d -r 0a34eaf12f82 .hgignore
--- a/.hgignore	Tue Dec 23 16:21:50 2008 -0500
+++ b/.hgignore	Tue Dec 23 22:49:34 2008 +0000
@@ -17,7 +17,12 @@
 *.svn
 *.bz2
 *.cache
+.*.swp
+
 .testerr
 */junit.xml
 */user.properties
 
+py/test/.coverage/
+py/test/.times
+py/test/annotate/
diff -r 4251ddd1989d -r 0a34eaf12f82 LICENSE
--- a/LICENSE	Tue Dec 23 16:21:50 2008 -0500
+++ b/LICENSE	Tue Dec 23 22:49:34 2008 +0000
@@ -1,4 +1,4 @@
-Copyright (c) 2005 rPath, Inc.
+Copyright (c) 2008 rPath, Inc.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of
 this software and associated documentation files (the "Software"), to deal in
diff -r 4251ddd1989d -r 0a34eaf12f82 Make.defs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Make.defs	Tue Dec 23 22:49:34 2008 +0000
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
+
+export prefix = /usr
+export lib = $(shell arch | sed -r '/x86_64|ppc64|s390x|sparc64/{s/.*/lib64/;q};s/.*/lib/')
+export bindir = $(prefix)/bin
+export sbindir = $(prefix)/sbin
+export libdir = $(prefix)/$(lib)
+export libexecdir = $(prefix)/libexec
+export datadir = $(prefix)/share
+export mandir = $(datadir)/man
+export pydir = $(libdir)/python$(PYVERSION)/site-packages
diff -r 4251ddd1989d -r 0a34eaf12f82 Make.rules
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Make.rules	Tue Dec 23 22:49:34 2008 +0000
@@ -0,0 +1,86 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
+
+.SILENT:
+
+export TOPDIR
+
+# Default rules
+default-build: subdirs-build
+	[ -n "$(DIR)" ] && \
+		echo Building in $(DIR) || \
+		echo Building in /
+
+default-install: subdirs-install
+	[ -n "$(DIR)" ] && \
+		echo Installing in $(DIR) || \
+		echo Installing in /
+
+default-clean: subdirs-clean
+	rm -f *~ *.pyo *.pyc *.orig *.o *.rej $(generated_files)
+
+default-test: subdirs-test
+
+
+# Subdirectory rules
+subdirs-build:
+ifdef SUBDIRS
+	for d in $(SUBDIRS); do make -C $$d DIR=$(DIR)/$$d build || exit 1; done
+endif
+
+subdirs-install:
+ifdef SUBDIRS
+	for d in $(SUBDIRS); do make -C $$d \
+		DIR=$(DIR)/$$d \
+		PYDEST=$(PYDIR)/$$d \
+		install || exit 1; done
+endif
+
+subdirs-clean:
+ifdef SUBDIRS
+	for d in $(SUBDIRS); do make -C $$d DIR=$(DIR)/$$d clean || exit 1; done
+endif
+
+subdirs-test:
+ifdef SUBDIRS
+	for d in $(SUBDIRS); do make -C $$d DIR=$(DIR)/$$d test || exit 1; done
+endif
+
+
+# Python rules
+PYTHON = $(shell [ -x /usr/bin/python2.4 ] && echo /usr/bin/python2.4)
+PYVERSION = $(shell $(PYTHON) -c 'import os, sys; print sys.version[:3]')
+PYINCLUDE = $(shell $(PYTHON) -c 'import os, sys; print os.sep.join((sys.prefix, "include", "python" + sys.version[:3]))')
+
+python-build:
+
+python-install:
+	mkdir -p "$(DESTDIR)$(pydir)$(PYDEST)"
+	install -m0644 $(python_files) "$(DESTDIR)$(pydir)$(PYDEST)/"
+	$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)$(pydir)$(PYDEST)', maxlevels=0, ddir='$(pydir)$(PYDEST)', quiet=1)"
+	$(PYTHON) -OO -c "import compileall; compileall.compile_dir('$(DESTDIR)$(pydir)$(PYDEST)', maxlevels=0, ddir='$(pydir)$(PYDEST)', quiet=1)"
+
+python-clean:
+
+python-test:
+
+
+# testutils rules
+testutils-build:
+
+testutils-install:
+
+testutils-clean:
+	rm -Rf .coverage .times annotate
+
+testutils-test:
+	XOBJ_PATH=$(TOPDIR)/py $(PYTHON) testsuite.py -v --coverage
diff -r 4251ddd1989d -r 0a34eaf12f82 Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Tue Dec 23 22:49:34 2008 +0000
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
+
+SUBDIRS = py #as3
+
+
+build: default-build
+
+install: default-install
+
+clean: default-clean
+
+test: default-test
+
+
+dist: archive
+
+archive:
+	hg archive --exclude .hgignore -t tbz2 xobj-`hg id -i`.tar.bz2
+
+
+export TOPDIR=$(shell pwd)
+include $(TOPDIR)/Make.rules
+include $(TOPDIR)/Make.defs
diff -r 4251ddd1989d -r 0a34eaf12f82 py/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/py/Makefile	Tue Dec 23 22:49:34 2008 +0000
@@ -0,0 +1,27 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
+
+SUBDIRS = xobj test
+
+
+build: default-build
+
+install: default-install
+
+clean: default-clean
+
+test: default-test
+
+
+export TOPDIR=$(shell pwd)/..
+include $(TOPDIR)/Make.rules
+include $(TOPDIR)/Make.defs
diff -r 4251ddd1989d -r 0a34eaf12f82 py/test/Makefile
--- a/py/test/Makefile	Tue Dec 23 16:21:50 2008 -0500
+++ b/py/test/Makefile	Tue Dec 23 22:49:34 2008 +0000
@@ -1,36 +1,26 @@
 #
-# Copyright (C) 2004-2006 rPath, Inc.
-# All rights reserved
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
 #
 
-SUBDIRS=
+default: test
 
-.PHONY: clean test debug-test
+build: default-build testutils-build
 
-dist_files = *.py Makefile archive/*
+install: default-install testutils-install
 
-all:
-	for dir in `find . -type d -name '*test' | fgrep -v .hg`; do \
-relativelink=`echo "$$dir" | sed s,/[^/]*,/..,g | sed 's,./,,'`; \
-ln -fs $${relativelink}/testsetup.py $$dir; \
-done
+clean: default-clean testutils-clean
 
-install:
-	echo "nothing to install"
+test: default-test testutils-test
 
-test:
-	python2.4 testsuite.py
 
-debug-test:
-	python2.4 testsuite.py --debug
-
-clean: clean-coverage
-	@find . \( -name \*~ -o -name \*.pyc \) -exec rm -fv {} \;
-	for dir in `find . -type d -name '*test'`; do \
-            rm -f $${dir}/testsetup.py*;\
-        done
-
-clean-coverage:
-	@find . \( -name \*,cover \) -exec rm -fv {} \;
-	@rm -rf .coverage
-
+export TOPDIR=$(shell pwd)/../..
+include $(TOPDIR)/Make.rules
+include $(TOPDIR)/Make.defs
diff -r 4251ddd1989d -r 0a34eaf12f82 py/xobj/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/py/xobj/Makefile	Tue Dec 23 22:49:34 2008 +0000
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
+
+python_files = $(wildcard *.py)
+override PYDEST = /xobj
+
+
+build: default-build python-build
+
+install: default-install python-install
+
+clean: default-clean python-clean
+
+test: default-test python-test
+
+
+export TOPDIR=$(shell pwd)/../..
+include $(TOPDIR)/Make.rules
+include $(TOPDIR)/Make.defs

From bpja@rpath.com Mon Jan  5 17:36:31 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n05HaVDk017042
	for <xobj-commits@lists.rpath.com>; Mon, 5 Jan 2009 17:36:31 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n05HaV2o007293
	for <xobj-commits@lists.rpath.com>; Mon, 5 Jan 2009 12:36:31 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n05HaUi5022924
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 5 Jan 2009 12:36:30 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n05HaU91008585
	for <xobj-commits@lists.rpath.com>; Mon, 5 Jan 2009 12:36:30 -0500
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n05HaUvb008580
	for xobj-commits@lists.rpath.com; Mon, 5 Jan 2009 12:36:30 -0500
From: Brett Adam <bpja@rpath.com>
Message-Id: <200901051736.n05HaUvb008580@scc.eng.rpath.com>
Date: Mon, 05 Jan 2009 12:36:30 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Bad defaults in actionScriptProperties
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 05 Jan 2009 17:36:31 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/XObjExplorer/.actionScriptProperties

Bad defaults in actionScriptProperties

diff -r 0a34eaf12f82 -r 24bccc704019 as3/XObjExplorer/.actionScriptProperties
--- a/as3/XObjExplorer/.actionScriptProperties	Tue Dec 23 22:49:34 2008 +0000
+++ b/as3/XObjExplorer/.actionScriptProperties	Mon Jan 05 12:35:39 2009 -0500
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<actionScriptProperties mainApplicationPath="FuckUP.mxml" version="3">
+<actionScriptProperties mainApplicationPath="XObjExplorer.mxml" version="3">
 <compiler additionalCompilerArguments="-locale en_US" copyDependentFiles="true" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin-debug" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
 <compilerSourcePath/>
 <libraryPath defaultLinkType="1">

From elliot@rpath.com Tue Jan  6 04:08:47 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n0648lwN024419
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 04:08:47 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n0648kZn003148
	for <xobj-commits@lists.rpath.com>; Mon, 5 Jan 2009 23:08:47 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n0648k8J030327
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 5 Jan 2009 23:08:46 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n0648kUe032400
	for <xobj-commits@lists.rpath.com>; Mon, 5 Jan 2009 23:08:46 -0500
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n0648kDG032395
	for xobj-commits@lists.rpath.com; Mon, 5 Jan 2009 23:08:46 -0500
From: Elliot Peele <elliot@rpath.com>
Message-Id: <200901060408.n0648kDG032395@scc.eng.rpath.com>
Date: Mon, 05 Jan 2009 23:08:46 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: add support for generating XML from python lists
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 04:08:47 -0000

tag:         tip
user:        Elliot Peele <https://issues.rpath.com/>
files:       py/test/xobjtest.py py/xobj/xobj.py

add support for generating XML from python lists
add tests for both lists and dicts

diff -r 24bccc704019 -r c7dea48bf177 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Mon Jan 05 12:35:39 2009 -0500
+++ b/py/test/xobjtest.py	Mon Jan 05 16:51:41 2009 -0500
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2008-2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
@@ -159,6 +159,95 @@
                       '</top>\n')
         self.assertEqual(o.tostring(), xmlOutText)
 
+    def testComplexListStrGen(self):
+        """
+        Test generating XML from a list of strings.
+        """
+
+        class Collection(object):
+            data = [ str ]
+        class DocumentClass(xobj.Document):
+            collection = Collection
+
+        collection = Collection()
+        collection.data = [ 'a', 'b', 'c', ]
+
+        xml = xobj.toxml(collection, 'collection')
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+        self.failUnlessEqual(collection.data, doc.collection.data)
+
+    def testComplexListObjGen(self):
+        """
+        Test generating XML from lists of objects.
+        """
+
+        class Basic(object):
+            foo = str
+        class BasicCollection(object):
+            data = [ Basic ]
+        class DocumentClass(xobj.Document):
+            collection = BasicCollection
+
+        basic = Basic()
+        basic.foo = 'a'
+
+        collection = BasicCollection()
+        collection.data = [ basic, ]
+
+        xml = xobj.toxml(collection, 'collection')
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+        self.failUnlessEqual(basic.foo, doc.collection.data[0].foo)
+
+    def testComplexDictStrGen(self):
+        """
+        Test generating XML from dictionaries of strings.
+        """
+
+        raise testhelp.SkipTestException('dicts not currently supported')
+
+        class Collection(object):
+            data = {str: str}
+        class DocumentClass(xobj.Document):
+            collection = Collection
+
+        collection = Collection()
+        collection.data = {'a': 'A'}
+
+        xml = xobj.toxml(collection, 'collection')
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+        self.failUnlessEqual(collection.data, doc.collection.data)
+
+    def testComplexDictObjGen(self):
+        """
+        Test generating XML from dictionaries of objects.
+        """
+
+        raise testhelp.SkipTestException('dicts not currently supported')
+
+        class Basic(object):
+            foo = str
+        class Collection(object):
+            data = {Basic: Basic}
+        class DocumentClass(xobj.Document):
+            collection = Collection
+
+        basicKey = Basic()
+        basicKey.foo = 'a'
+
+        basicVal = Basic()
+        basicVal.foo = 'A'
+
+        collection = Collection()
+        collection.data = {basicKey: basicVal}
+
+        xml = xobj.toxml(collection, 'collection')
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+
+        key = doc.collection.data.keys()[0]
+        val = doc.colleciton.data[key]
+
+        self.failUnlessEqual(key.foo, basicKey.foo)
+        self.failUnlessEqual(val.foo, basicVal.foo)
 
     def testNamespaces(self):
         xmlString = _xml('namespaces',
@@ -409,5 +498,65 @@
         assert("<unknown>unknown</unknown>" in
                     xobj.toxml(t, 'top', xml_declaration = False))
 
+    def testSimpleMultiParse(self):
+        """
+        Test parsing multiple xml documents with one set of classes.
+        """
+
+        class Top(object):
+            foo = str
+        class DocumentClass(xobj.Document):
+            top = Top
+
+        topA = Top()
+        topA.foo = 'A'
+        xmlA = xobj.toxml(topA, 'top')
+
+        topB = Top()
+        topB.foo = 'B'
+        xmlB = xobj.toxml(topB, 'top')
+
+        docA = xobj.parse(xmlA, documentClass=DocumentClass)
+        docB = xobj.parse(xmlB, documentClass=DocumentClass)
+
+        self.failUnlessEqual('A', docA.top.foo)
+        self.failUnlessEqual('B', docB.top.foo)
+
+    def testComplexMultiParse(self):
+        """
+        Test parsing multiple xml documents with one set of classes using more
+        complex types.
+        """
+
+        class Top(object):
+            foo = [ str ]
+        class DocumentClass(xobj.Document):
+            top = Top
+
+        xmlTextA = _xml('complex',
+                       '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                       '<top>\n'
+                       '  <foo>a</foo>\n'
+                       '  <foo>b</foo>\n'
+                       '</top>\n')
+
+        xmlA = StringIO(xmlTextA)
+        docA = xobj.parsef(xmlA, documentClass=DocumentClass)
+
+        xmlTextB = _xml('complex',
+                       '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                       '<top>\n'
+                       '  <foo>A</foo>\n'
+                       '  <foo>B</foo>\n'
+                       '</top>\n')
+
+        xmlB = StringIO(xmlTextB)
+        docB = xobj.parsef(xmlB, documentClass=DocumentClass)
+
+        self.failUnlessEqual('a', docA.top.foo[0])
+        self.failUnlessEqual('b', docA.top.foo[1])
+        self.failUnlessEqual('A', docB.top.foo[0])
+        self.failUnlessEqual('B', docB.top.foo[1])
+
 if __name__ == "__main__":
     testsuite.main()
diff -r 24bccc704019 -r c7dea48bf177 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Mon Jan 05 12:35:39 2009 -0500
+++ b/py/xobj/xobj.py	Mon Jan 05 16:51:41 2009 -0500
@@ -143,6 +143,12 @@
             element = etree.SubElement(rootElement, tag, {})
             element.text = xobj
             return element
+
+        if type(xobj) == list:
+            for item in xobj:
+                element = self.getElementTree(item, tag, rootElement=rootElement, nsmap=nsmap)
+                rootElement.append(element)
+            return rootElement
 
         tag = addns(tag)
 

From elliot@rpath.com Tue Jan  6 04:47:56 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n064ltqV024731
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 04:47:55 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n064ltKI005907
	for <xobj-commits@lists.rpath.com>; Mon, 5 Jan 2009 23:47:55 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n064ltqs000382
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 5 Jan 2009 23:47:55 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n064lsbZ001322
	for <xobj-commits@lists.rpath.com>; Mon, 5 Jan 2009 23:47:54 -0500
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n064lsZ2001317
	for xobj-commits@lists.rpath.com; Mon, 5 Jan 2009 23:47:54 -0500
From: Elliot Peele <elliot@rpath.com>
Message-Id: <200901060447.n064lsZ2001317@scc.eng.rpath.com>
Date: Mon, 05 Jan 2009 23:47:54 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: more accurate handling of list serialization
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 04:47:56 -0000

tag:         tip
user:        Elliot Peele <https://issues.rpath.com/>
files:       py/xobj/xobj.py

more accurate handling of list serialization

diff -r c7dea48bf177 -r e2beed6535b7 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Mon Jan 05 16:51:41 2009 -0500
+++ b/py/xobj/xobj.py	Mon Jan 05 23:47:24 2009 -0500
@@ -144,12 +144,6 @@
             element.text = xobj
             return element
 
-        if type(xobj) == list:
-            for item in xobj:
-                element = self.getElementTree(item, tag, rootElement=rootElement, nsmap=nsmap)
-                rootElement.append(element)
-            return rootElement
-
         tag = addns(tag)
 
         if hasattr(xobj, '_xobj'):
@@ -185,7 +179,10 @@
                     attrs[key] = str(val)
                 else:
                     l = elements.setdefault(key, [])
-                    l.append(val)
+                    if type(val) == list:
+                        l.extend(val)
+                    else:
+                        l.append(val)
 
         orderedElements = []
 

From bpja@rpath.com Tue Jan  6 05:08:06 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n06586ql024889
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 05:08:06 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n06586Ae007422
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:08:06 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n06585J6002046
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:08:05 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n06585Sn003487
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:08:05 -0500
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n06585rC003482
	for xobj-commits@lists.rpath.com; Tue, 6 Jan 2009 00:08:05 -0500
From: Brett Adam <bpja@rpath.com>
Message-Id: <200901060508.n06585rC003482@scc.eng.rpath.com>
Date: Tue, 06 Jan 2009 00:08:05 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Missing project references for correct build sequence in
	FlexBuilder
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 05:08:06 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/XObjExplorer/.project

Missing project references for correct build sequence in FlexBuilder

diff -r e2beed6535b7 -r 452e184edc9e as3/XObjExplorer/.project
--- a/as3/XObjExplorer/.project	Mon Jan 05 23:47:24 2009 -0500
+++ b/as3/XObjExplorer/.project	Tue Jan 06 00:08:01 2009 -0500
@@ -3,7 +3,7 @@
 	<name>XObjExplorer</name>
 	<comment></comment>
 	<projects>
-		<project>RESTful</project>
+		<project>xobjas3</project>
 	</projects>
 	<buildSpec>
 		<buildCommand>

From ewt@rpath.com Tue Jan  6 05:10:12 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n065ABci024924
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 05:10:11 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n065ABwu007591
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:11 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n065AB2a002202
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:11 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n065AAIg003692
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:10 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n065AAWY003675
	for xobj-commits@lists.rpath.com; Tue, 6 Jan 2009 00:10:10 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200901060510.n065AAWY003675@scc.eng.rpath.com>
Date: Tue, 06 Jan 2009 00:10:10 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: make sure idref's match id's during generation
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 05:10:12 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

make sure idref's match id's during generation

diff -r 4251ddd1989d -r 8da8777e1c24 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Tue Dec 23 16:21:50 2008 -0500
+++ b/py/test/xobjtest.py	Mon Jan 05 08:45:55 2009 -0500
@@ -73,7 +73,7 @@
         class SubelementClass(object):
             subattr = [ int ]
         TopClass.subelement = SubelementClass
-        TopClass.prop = xobj.XObject
+        TopClass.prop = xobj.XObj
 
         o = xobj.parsef(xml, documentClass = DocumentClass)
         self.assertEqual(o.top.subelement.subattr, [ 2 ] )
@@ -128,10 +128,10 @@
         class PropClass(object):
             subprop = [ SubpropClass ]
 
-        class SimpleClass(xobj.XObject):
+        class SimpleClass(xobj.XObj):
             pass
 
-        class TopClass(xobj.XObject):
+        class TopClass(xobj.XObj):
             unused = str
             prop = PropClass
             simple = [ SimpleClass ]
@@ -225,10 +225,11 @@
             '</top>\n')
         xml = StringIO(s)
 
-        class Ref(xobj.XObject):
+        class Ref(xobj.XObj):
+            _xobj = xobj.XObjMetadata(attributes = [ 'other' ])
             other = xobj.XIDREF
 
-        class Top(xobj.XObject):
+        class Top(xobj.XObj):
             ref = Ref
 
         class Document(xobj.Document):
@@ -253,7 +254,8 @@
         else:
             assert(0)
 
-        class Item(xobj.XObject):
+        class Item(xobj.XObj):
+            _xobj = xobj.XObjMetadata(attributes = [ 'anid' ])
             anid = xobj.XID
         Top.item = Item
 
@@ -262,19 +264,40 @@
         s2 = d.tostring(xml_declaration = False)
         self.assertEquals(s, s2)
 
+        # test outputing an idref w/o a corresponding id
+        t = Top()
+        t.item = Item()
+        t.item.anid = 'foo'
+        t.ref = Ref()
+        t.ref.other = Item()
+        t.ref.other.anid = 'bar'
+        try:
+            xobj.toxml(t, 'top', xml_declaration = False)
+        except xobj.UnmatchedIdRef, e:
+            assert(str(e) == 'Unmatched idref values during XML creation '
+                             'for id(s): bar')
+
+        t.ref.other = t.item
+        s = xobj.toxml(t, 'top', xml_declaration = False)
+        self.assertEquals(s, '<top>\n'
+                             '  <item anid="foo"/>\n'
+                             '  <ref other="foo"/>\n'
+                             '</top>\n')
+
         # and test if the id isn't defined properly
-        class Top(xobj.XObject):
+        class Top(xobj.XObj):
             _xobj = xobj.XObjMetadata(attributes = [ 'ref' ])
             ref = xobj.XIDREF
         Document.top = Top
 
         d = Document()
         d.top = Top()
-        d.top.ref = xobj.XObject('something')
+        d.top.ref = xobj.XObj('something')
         try:
             d.tostring()
         except xobj.XObjSerializationException, e:
-            self.assertEquals(str(e), 'No id found for element referenced by ref')
+            self.assertEquals(str(e), 'No id found for element referenced '
+                                      'by ref')
         else:
             assert(0)
 
@@ -318,27 +341,27 @@
         d = xobj.parsef(xml, documentClass = D)
         assert(d.top.item.val == 3)
 
-        class I(xobj.XObject):
+        class I(xobj.XObj):
             val = int
 
         d = xobj.parsef(xml, typeMap = { 'item' : I} )
         assert(d.top.item.val == 3)
 
     def testEmptyList(self):
-        class Top(xobj.XObject):
+        class Top(xobj.XObj):
             l = [ int ]
 
         d = xobj.parse("<top/>", typeMap = { 'top' : Top })
         assert(d.top.l == [])
 
     def testUnion(self):
-        class TypeA(xobj.XObject):
+        class TypeA(xobj.XObj):
             vala = int
 
-        class TypeB(xobj.XObject):
+        class TypeB(xobj.XObj):
             valb = int
 
-        class Top(xobj.XObject):
+        class Top(xobj.XObj):
             items = [ { 'typea' : TypeA,
                         'typeb' : TypeB } ]
 
@@ -409,5 +432,9 @@
         assert("<unknown>unknown</unknown>" in
                     xobj.toxml(t, 'top', xml_declaration = False))
 
+    def testIntElement(self):
+        xml = _xml('intelement', '<top><anint>5</anint></top>')
+        doc = xobj.parse(xml, typeMap = { 'anint' : int })
+
 if __name__ == "__main__":
     testsuite.main()
diff -r 4251ddd1989d -r 8da8777e1c24 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Tue Dec 23 16:21:50 2008 -0500
+++ b/py/xobj/xobj.py	Mon Jan 05 08:45:55 2009 -0500
@@ -19,6 +19,20 @@
     Exception raised when a class prototype specifies a type which is not
     understood.
     """
+
+class UnmatchedIdRef(Exception):
+
+    """
+    Exception raised when idref's cannot be matched with an id during
+    XML generation.
+    """
+
+    def __str__(self):
+        return ("Unmatched idref values during XML creation for id(s): %s"
+                    % ",".join(str(x) for x in self.idList))
+
+    def __init__(self, idList):
+        self.idList = idList
 
 class XType(object):
 
@@ -47,7 +61,9 @@
 
     if xObjectType == str or xObjectType == object:
         # Basic object's are static, making instantiating one pretty worthless.
-        return XType(XObject)
+        return XType(XObj)
+    elif xObjectType == int:
+        return XType(XObjInt)
     elif type(xObjectType) == list:
         assert(len(xObjectType) == 1)
         return XType(XTypeFromXObjectType(xObjectType[0]).pythonType,
@@ -55,7 +71,7 @@
 
     return XType(xObjectType)
 
-class XObject(str):
+class XObj(str):
 
     """
     Example class for all elements represented in XML. Subclasses of XObject
@@ -68,7 +84,7 @@
 
     using this class:
 
-        class Element(xobj.XObject):
+        class Element(xobj.XObj):
 
             intAttr = int                       # force an int
             subelement = [ str ]                # force a list
@@ -89,6 +105,10 @@
         else:
             return object.__repr__(self)
 
+class XObjInt(int):
+
+    pass
+
 class XObjMetadata(object):
 
     __slots__ = [ 'elements', 'attributes', 'tag' ]
@@ -106,28 +126,17 @@
 
         self.tag = None
 
-class XID(XObject):
+class XID(XObj):
 
     pass
 
-class XIDREF(XObject):
+class XIDREF(XObj):
 
     pass
 
-class Document(XObject):
+class ElementGenerator(object):
 
-    nameSpaceMap = {}
-    typeMap = {}
-
-    def __init__(self):
-        self._idsNeeded = []
-        self._dynamicClassDict = {}
-        self._ids = {}
-        self.__explicitNamespaces = False
-        self.__xmlNsMap = {}
-        self._xobj = XObjMetadata()
-
-    def getElementTree(self, xobj, tag, rootElement = None, nsmap = {}):
+    def getElementTree(self, xobj, tag, parentElement = None, nsmap = {}):
 
         def addns(s):
             for short, long in nsmap.iteritems():
@@ -140,7 +149,7 @@
             xobj = str(xobj)
 
         if type(xobj) == str:
-            element = etree.SubElement(rootElement, tag, {})
+            element = etree.SubElement(parentElement, tag, {})
             element.text = xobj
             return element
 
@@ -174,6 +183,10 @@
                                     'No id found for element referenced by %s'
                                     % key)
                         val = idVal
+                        self.idsNeeded.add(idVal)
+                    elif (key == 'id' or
+                          (pythonType and issubclass(pythonType, XID))):
+                        self.idsFound.add(val)
 
                     key = addns(key)
                     attrs[key] = str(val)
@@ -193,10 +206,10 @@
         else:
             orderedElements = sorted(elements.iteritems())
 
-        if rootElement is None:
+        if parentElement is None:
             element = etree.Element(tag, attrs, nsmap = nsmap)
         else:
-            element = etree.SubElement(rootElement, tag, attrs)
+            element = etree.SubElement(parentElement, tag, attrs)
 
         if isinstance(xobj, str) and xobj:
             element.text = str(xobj)
@@ -205,18 +218,39 @@
             if val is not None:
                 if type(val) == list:
                     for subval in val:
-                        self.getElementTree(subval, key, rootElement = element,
-                                              nsmap = nsmap)
+                        self.getElementTree(subval, key,
+                                            parentElement = element,
+                                            nsmap = nsmap)
                 else:
-                    self.getElementTree(val, key, rootElement = element,
-                                       nsmap = nsmap)
+                    self.getElementTree(val, key, parentElement = element,
+                                        nsmap = nsmap)
 
         return element
+
+    def __init__(self, xobj, tag, nsmap = {}):
+        self.idsNeeded = set()
+        self.idsFound = set()
+        self.element = self.getElementTree(xobj, tag, nsmap = nsmap)
+        if (self.idsNeeded - self.idsFound):
+            raise UnmatchedIdRef(self.idsNeeded - self.idsFound)
+
+class Document(XObj):
+
+    nameSpaceMap = {}
+    typeMap = {}
+
+    def __init__(self):
+        self._idsNeeded = []
+        self._dynamicClassDict = {}
+        self._ids = {}
+        self.__explicitNamespaces = False
+        self.__xmlNsMap = {}
+        self._xobj = XObjMetadata()
 
     def tostring(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
         for key, val in self.__dict__.iteritems():
             if key[0] == '_': continue
-            if isinstance(val, XObject):
+            if isinstance(val, XObj):
                 break
 
         if self.__explicitNamespaces:
@@ -225,8 +259,8 @@
         else:
             map = self.__xmlNsMap
 
-        et = self.getElementTree(val, key, nsmap = map)
-        xmlString = etree.tostring(et, pretty_print = prettyPrint,
+        gen = ElementGenerator(val, key, nsmap = map)
+        xmlString = etree.tostring(gen.element, pretty_print = prettyPrint,
                                    encoding = 'UTF-8',
                                    xml_declaration = xml_declaration)
 
@@ -268,7 +302,7 @@
                     doc._ids[val] = xobj
 
                 expectedXType = None
-                val = XObject(val)
+                val = XObj(val)
 
             addAttribute(xobj, key, val, xType = expectedXType)
 
@@ -358,7 +392,7 @@
             else:
                 localTag = nsmap(element.tag)
                 # create a subclass for this type
-                NewClass = type(localTag + '_XObj_Type', (XObject,), {})
+                NewClass = type(localTag + '_XObj_Type', (XObj,), {})
                 self._dynamicClassDict[tag] = XType(NewClass)
 
                 if text:
@@ -469,8 +503,8 @@
 
 def toxml(xobj, tag, prettyPrint = True, xml_declaration = True):
     d = Document()
-    et = d.getElementTree(xobj, tag)
-    xmlString = etree.tostring(et, pretty_print = prettyPrint,
+    gen = ElementGenerator(xobj, tag)
+    xmlString = etree.tostring(gen.element, pretty_print = prettyPrint,
                                encoding = 'UTF-8',
                                xml_declaration = xml_declaration)
 

From ewt@rpath.com Tue Jan  6 05:10:12 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n065ACjM024927
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 05:10:12 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n065ACAG007594
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:12 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n065AC6p002205
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:12 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n065AB64003725
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:11 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n065ABEw003707
	for xobj-commits@lists.rpath.com; Tue, 6 Jan 2009 00:10:11 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200901060510.n065ABEw003707@scc.eng.rpath.com>
Date: Tue, 06 Jan 2009 00:10:11 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: move etree.tostring() call into ElementGenerator() class
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 05:10:13 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       py/xobj/xobj.py

move etree.tostring() call into ElementGenerator() class

diff -r 8da8777e1c24 -r 164eecb5b39d py/xobj/xobj.py
--- a/py/xobj/xobj.py	Mon Jan 05 08:45:55 2009 -0500
+++ b/py/xobj/xobj.py	Mon Jan 05 08:59:35 2009 -0500
@@ -227,6 +227,11 @@
 
         return element
 
+    def tostring(self, prettyPrint = True, xml_declaration = True):
+        return etree.tostring(self.element, pretty_print = prettyPrint,
+                              encoding = 'UTF-8',
+                              xml_declaration = xml_declaration)
+
     def __init__(self, xobj, tag, nsmap = {}):
         self.idsNeeded = set()
         self.idsFound = set()
@@ -260,11 +265,8 @@
             map = self.__xmlNsMap
 
         gen = ElementGenerator(val, key, nsmap = map)
-        xmlString = etree.tostring(gen.element, pretty_print = prettyPrint,
-                                   encoding = 'UTF-8',
-                                   xml_declaration = xml_declaration)
-
-        return xmlString
+        return gen.tostring(prettyPrint = prettyPrint,
+                            xml_declaration = xml_declaration)
 
     def fromElementTree(self, xml, rootXClass = None, nameSpaceMap = {},
                         unionTags = {}):
@@ -502,10 +504,6 @@
     return parsef(s, schemaf, documentClass = documentClass, typeMap = typeMap)
 
 def toxml(xobj, tag, prettyPrint = True, xml_declaration = True):
-    d = Document()
     gen = ElementGenerator(xobj, tag)
-    xmlString = etree.tostring(gen.element, pretty_print = prettyPrint,
-                               encoding = 'UTF-8',
-                               xml_declaration = xml_declaration)
-
-    return xmlString
+    return gen.tostring(prettyPrint = prettyPrint,
+                        xml_declaration = xml_declaration)

From ewt@rpath.com Tue Jan  6 05:10:13 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n065ADdT024930
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 05:10:13 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n065AD5Z007599
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:13 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n065ADHK002208
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:13 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n065AC7R003763
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:12 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n065ACUM003752
	for xobj-commits@lists.rpath.com; Tue, 6 Jan 2009 00:10:12 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200901060510.n065ACUM003752@scc.eng.rpath.com>
Date: Tue, 06 Jan 2009 00:10:12 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: 1. added support for validating created xml against a
 schema
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 05:10:14 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

1. added support for validating created xml against a schema
2. renamed Document.tostring() to Docuemnt.toxml()

diff -r 164eecb5b39d -r 3a1ec8f9810f py/test/xobjtest.py
--- a/py/test/xobjtest.py	Mon Jan 05 08:59:35 2009 -0500
+++ b/py/test/xobjtest.py	Mon Jan 05 09:17:21 2009 -0500
@@ -45,8 +45,8 @@
         self.assertEqual(o.top.subelement.subattr, '2')
         self.assertEqual(o.top.subelement.__class__.__name__,
                          'subelement_XObj_Type')
-        assert(repr(o.startswith('<xobj.xobj.Document object')))
-        assert(repr(o.top.startswith('<xobj.xobj.top_XObj_Type object')))
+        assert(repr(o).startswith('<xobj.xobj.Document object'))
+        assert(repr(o.top).startswith('<xobj.xobj.top_XObj_Type object'))
         assert(repr(o.top.subelement).startswith(
                                     '<xobj.xobj.subelement_XObj_Type object'))
         self.assertEqual(repr(o.top.attr1), "'anattr'")
@@ -102,7 +102,7 @@
 
         # ---
 
-        self.assertEqual(o.tostring(), xmlText)
+        self.assertEqual(o.toxml(), xmlText)
 
         # ---
 
@@ -157,7 +157,7 @@
                       '  </prop>\n'
                       '  <simple>simple</simple>\n'
                       '</top>\n')
-        self.assertEqual(o.tostring(), xmlOutText)
+        self.assertEqual(o.toxml(), xmlOutText)
 
 
     def testNamespaces(self):
@@ -172,7 +172,7 @@
         o = xobj.parsef(xml)
         assert(o.top.other_tag.other_val == '1')
         assert(o.top.other2_tag.val == '2')
-        assert(o.tostring(xml_declaration = False) == xmlString)
+        assert(o.toxml(xml_declaration = False) == xmlString)
 
         class Top(xobj.Document):
             nameSpaceMap = { 'other3' : 'http://other/other2' }
@@ -182,7 +182,7 @@
         assert(o.top.other3_tag.val == '2')
         newXmlString = xmlString.replace("other2:", "other3:")
         newXmlString = newXmlString.replace(":other2", ":other3")
-        assert(o.tostring(xml_declaration = False) == newXmlString)
+        assert(o.toxml(xml_declaration = False) == newXmlString)
 
     def testSchemaValidation(self):
         s = (
@@ -210,7 +210,13 @@
             '  <subelement subattr="2"/>\n'
             '</top>\n')
         xml = StringIO(s)
-        xobj.parsef(xml, schemaf = schema)
+        d = xobj.parsef(xml, schemaf = schema)
+        s2 = d.toxml(xml_declaration = False)
+        assert(s == s2)
+        d.top.unknown = 'foo'
+        self.assertRaises(xobj.DocumentInvalid, d.toxml)
+        self.assertRaises(xobj.DocumentInvalid, xobj.toxml,
+                          d.top, 'top', schemaf = schema)
 
         xml = StringIO(s.replace('prop', 'prop2'))
         xobj.parsef(xml)
@@ -237,7 +243,7 @@
 
         d = xobj.parsef(xml, documentClass = Document)
         assert(d.top.ref.other == d.top.item)
-        s2 = d.tostring(xml_declaration = False)
+        s2 = d.toxml(xml_declaration = False)
         self.assertEquals(s, s2)
 
         # now test if the id is called something else
@@ -261,7 +267,7 @@
 
         d = xobj.parsef(xml, documentClass = Document)
         assert(d.top.ref.other == d.top.item)
-        s2 = d.tostring(xml_declaration = False)
+        s2 = d.toxml(xml_declaration = False)
         self.assertEquals(s, s2)
 
         # test outputing an idref w/o a corresponding id
@@ -294,7 +300,7 @@
         d.top = Top()
         d.top.ref = xobj.XObj('something')
         try:
-            d.tostring()
+            d.toxml()
         except xobj.XObjSerializationException, e:
             self.assertEquals(str(e), 'No id found for element referenced '
                                       'by ref')
@@ -312,7 +318,7 @@
         d = xobj.parsef(xml)
         assert(d.ns_top.ns_element.ns_attr == 'foo')
         assert(d.__class__ == xobj.Document)
-        s2 = d.tostring(xml_declaration = False)
+        s2 = d.toxml(xml_declaration = False)
 
         expecteds2 = (
             '<ns:top xmlns:ns="http://somens.xsd">\n'
@@ -380,7 +386,7 @@
         assert(d.top.items[2].vala == 3)
         assert(d.top.items[3].valb == 4)
         assert(d.top.items[4].vala == 5)
-        assert(s == d.tostring(xml_declaration = False))
+        assert(s == d.toxml(xml_declaration = False))
 
         d = xobj.parse('<top/>', typeMap = { 'top' : Top } )
         assert(d.top.items == [])
diff -r 164eecb5b39d -r 3a1ec8f9810f py/xobj/xobj.py
--- a/py/xobj/xobj.py	Mon Jan 05 08:59:35 2009 -0500
+++ b/py/xobj/xobj.py	Mon Jan 05 09:17:21 2009 -0500
@@ -12,6 +12,8 @@
 from lxml import etree
 import types
 from StringIO import StringIO
+
+DocumentInvalid = etree.DocumentInvalid
 
 class UnknownXType(Exception):
 
@@ -232,27 +234,32 @@
                               encoding = 'UTF-8',
                               xml_declaration = xml_declaration)
 
-    def __init__(self, xobj, tag, nsmap = {}):
+    def __init__(self, xobj, tag, nsmap = {}, schema = None):
         self.idsNeeded = set()
         self.idsFound = set()
         self.element = self.getElementTree(xobj, tag, nsmap = nsmap)
         if (self.idsNeeded - self.idsFound):
             raise UnmatchedIdRef(self.idsNeeded - self.idsFound)
 
-class Document(XObj):
+        if schema:
+            schema.assertValid(self.element)
+
+class Document(object):
 
     nameSpaceMap = {}
     typeMap = {}
 
-    def __init__(self):
+    def __init__(self, schema = None):
+        XObj.__init__(self)
         self._idsNeeded = []
         self._dynamicClassDict = {}
         self._ids = {}
         self.__explicitNamespaces = False
         self.__xmlNsMap = {}
         self._xobj = XObjMetadata()
+        self.__schema = schema
 
-    def tostring(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
+    def toxml(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
         for key, val in self.__dict__.iteritems():
             if key[0] == '_': continue
             if isinstance(val, XObj):
@@ -264,7 +271,7 @@
         else:
             map = self.__xmlNsMap
 
-        gen = ElementGenerator(val, key, nsmap = map)
+        gen = ElementGenerator(val, key, nsmap = map, schema = self.__schema)
         return gen.tostring(prettyPrint = prettyPrint,
                             xml_declaration = xml_declaration)
 
@@ -482,16 +489,16 @@
 
 def parsef(f, schemaf = None, documentClass = Document, typeMap = {}):
     if schemaf:
-        schemaObj = etree.XMLSchema(etree.parse(schemaf))
+        schemaObj = etree.XMLSchema(file = schemaf)
     else:
         schemaObj = None
 
     if typeMap:
         newClass = type('XObj_Dynamic_Document', (documentClass,),
                         { 'typeMap' : typeMap})
-        document = newClass()
+        document = newClass(schema = schemaObj)
     else:
-        document = documentClass()
+        document = documentClass(schema = schemaObj)
 
     parser = etree.XMLParser(schema = schemaObj)
     xml = etree.parse(f, parser)
@@ -503,7 +510,14 @@
     s = StringIO(s)
     return parsef(s, schemaf, documentClass = documentClass, typeMap = typeMap)
 
-def toxml(xobj, tag, prettyPrint = True, xml_declaration = True):
-    gen = ElementGenerator(xobj, tag)
+def toxml(xobj, tag, prettyPrint = True, xml_declaration = True,
+          schemaf = None):
+    if schemaf:
+        schemaObj = etree.XMLSchema(file = schemaf)
+    else:
+        schemaObj = None
+
+    gen = ElementGenerator(xobj, tag, schema = schemaObj)
+
     return gen.tostring(prettyPrint = prettyPrint,
                         xml_declaration = xml_declaration)

From ewt@rpath.com Tue Jan  6 05:10:14 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n065AEjo024936
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 05:10:14 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n065AEBH007603
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:14 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n065AEaW002211
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:14 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n065AD8U003807
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:13 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n065ADmj003793
	for xobj-commits@lists.rpath.com; Tue, 6 Jan 2009 00:10:13 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200901060510.n065ADmj003793@scc.eng.rpath.com>
Date: Tue, 06 Jan 2009 00:10:13 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: handle id names which are inside of a namespace
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 05:10:14 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

handle id names which are inside of a namespace

diff -r 3a1ec8f9810f -r 5307bafa7fee py/test/xobjtest.py
--- a/py/test/xobjtest.py	Mon Jan 05 09:17:21 2009 -0500
+++ b/py/test/xobjtest.py	Mon Jan 05 09:55:44 2009 -0500
@@ -307,6 +307,22 @@
         else:
             assert(0)
 
+    def testIdInNamespace(self):
+        s = _xml('id-in-ns1',
+            '<ns:top xmlns:ns="http://somens.xsd">\n'
+            '  <ns:item ns:id="theid" ns:val="value"/>\n'
+            '  <ns:ref ns:other="theid"/>\n'
+            '</ns:top>\n')
+        xml = StringIO(s)
+
+        class Ref(object):
+            ns_other = xobj.XIDREF
+
+        d = xobj.parsef(xml, typeMap = { 'ns_ref' : Ref } )
+        assert(d.ns_top.ns_ref.ns_other == d.ns_top.ns_item)
+        s2 = d.toxml(xml_declaration = False)
+        assert(s == s2)
+
     def testExplicitNamespaces(self):
         s = _xml('explicitns',
             '<top xmlns="http://somens.xsd" xmlns:ns="http://somens.xsd">\n'
diff -r 3a1ec8f9810f -r 5307bafa7fee py/xobj/xobj.py
--- a/py/xobj/xobj.py	Mon Jan 05 09:17:21 2009 -0500
+++ b/py/xobj/xobj.py	Mon Jan 05 09:55:44 2009 -0500
@@ -174,11 +174,21 @@
                     if pythonType and issubclass(pythonType, XIDREF):
                         idVal = getattr(val, 'id', None)
                         if idVal is None:
+                            # look for an id name in a different namespace
+                            for idKey, idType in (
+                                        val.__dict__.iteritems()):
+                                if idKey.endswith('_id'):
+                                    idVal = getattr(val, idKey)
+                                    break
+
+                        if idVal is None:
+                            # look for something prorotyped XID
                             for idKey, idType in (
                                         val.__class__.__dict__.iteritems()):
                                 if (idKey[0] != '_' and type(idType) == type
                                                 and issubclass(idType, XID)):
                                     idVal = getattr(val, idKey)
+                                    break
 
                         if idVal is None:
                             raise XObjSerializationException(
@@ -186,7 +196,7 @@
                                     % key)
                         val = idVal
                         self.idsNeeded.add(idVal)
-                    elif (key == 'id' or
+                    elif (key == 'id' or key.endswith('_id') or
                           (pythonType and issubclass(pythonType, XID))):
                         self.idsFound.add(val)
 
@@ -262,8 +272,7 @@
     def toxml(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
         for key, val in self.__dict__.iteritems():
             if key[0] == '_': continue
-            if isinstance(val, XObj):
-                break
+            break
 
         if self.__explicitNamespaces:
             map = self.__xmlNsMap.copy()
@@ -298,7 +307,7 @@
 
             if expectedType:
                 expectedXType = XTypeFromXObjectType(expectedType)
-                if (key == 'id' or key == 'xml_id' or
+                if (key == 'id' or key.endswith('_id') or
                             issubclass(expectedXType.pythonType, XID)):
                     doc._ids[val] = xobj
                 elif issubclass(expectedXType.pythonType, XIDREF):
@@ -307,7 +316,7 @@
                 else:
                     val = expectedXType.pythonType(val)
             else:
-                if (key == 'id' or key == 'xml_id'):
+                if (key == 'id' or key.endswith('_id')):
                     doc._ids[val] = xobj
 
                 expectedXType = None

From ewt@rpath.com Tue Jan  6 05:10:15 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n065AF4E024940
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 05:10:15 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n065AFx4007610
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:15 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n065AFwN002216
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:15 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n065AEvL003844
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:14 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n065AEbG003834
	for xobj-commits@lists.rpath.com; Tue, 6 Jan 2009 00:10:14 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200901060510.n065AEbG003834@scc.eng.rpath.com>
Date: Tue, 06 Jan 2009 00:10:14 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: allow xobj metadata objects to define the types for attributes
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 05:10:16 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

allow xobj metadata objects to define the types for attributes

diff -r 5307bafa7fee -r f5fdda96f29a py/test/xobjtest.py
--- a/py/test/xobjtest.py	Mon Jan 05 09:55:44 2009 -0500
+++ b/py/test/xobjtest.py	Mon Jan 05 10:57:49 2009 -0500
@@ -458,5 +458,26 @@
         xml = _xml('intelement', '<top><anint>5</anint></top>')
         doc = xobj.parse(xml, typeMap = { 'anint' : int })
 
+    def testMetadataAttributeTypes(self):
+        class Bar:
+            _xobj = xobj.XObjMetadata(
+                        attributes = { 'ref' : xobj.XIDREF } )
+
+        class Top:
+            _xobj = xobj.XObjMetadata(
+                        attributes = { 'val' : int } )
+            bar = Bar
+
+        s = ('<top id="foo" val="5">\n'
+             '  <bar ref="foo"/>\n'
+             '</top>\n')
+
+        d = xobj.parse(s, typeMap = { 'top' : Top })
+        assert(d.top.val == 5)
+        assert(d.top == d.top.bar.ref)
+
+        s2 = d.toxml(xml_declaration = False)
+        assert(s == s2)
+
 if __name__ == "__main__":
     testsuite.main()
diff -r 5307bafa7fee -r f5fdda96f29a py/xobj/xobj.py
--- a/py/xobj/xobj.py	Mon Jan 05 09:55:44 2009 -0500
+++ b/py/xobj/xobj.py	Mon Jan 05 10:57:49 2009 -0500
@@ -122,9 +122,12 @@
             self.elements = []
 
         if attributes:
-            self.attributes = set(attributes)
+            if type(attributes) == dict:
+                self.attributes = attributes.copy()
+            else:
+                self.attributes = dict( (x, None) for x in attributes )
         else:
-            self.attributes = set()
+            self.attributes = dict()
 
         self.tag = None
 
@@ -135,6 +138,17 @@
 class XIDREF(XObj):
 
     pass
+
+def findPythonType(xobj, key):
+    pc = getattr(xobj.__class__, key, None)
+    if pc is not None:
+        return pc
+
+    md = getattr(xobj.__class__, '_xobj', None)
+    if md is None:
+        return None
+
+    return md.attributes.get(key, None)
 
 class ElementGenerator(object):
 
@@ -170,7 +184,8 @@
         for key, val in xobj.__dict__.iteritems():
             if key[0] != '_':
                 if key in attrSet:
-                    pythonType = getattr(xobj.__class__, key, None)
+                    pythonType = findPythonType(xobj, key)
+
                     if pythonType and issubclass(pythonType, XIDREF):
                         idVal = getattr(val, 'id', None)
                         if idVal is None:
@@ -301,7 +316,7 @@
             return s
 
         def setAttribute(xobj, doc, key, val):
-            expectedType = getattr(xobj.__class__, key, None)
+            expectedType = findPythonType(xobj, key)
             if expectedType is None:
                 expectedType = doc.typeMap.get(key, None)
 
@@ -326,7 +341,9 @@
 
         def addAttribute(xobj, key, val, xType = None):
             setItem(xobj, key, val, xType)
-            xobj._xobj.attributes.add(key)
+            if key not in xobj._xobj.attributes:
+                # preserver any type information we copied in
+                xobj._xobj.attributes[key] = None
 
         def addElement(xobj, key, val, xType = None):
             setItem(xobj, key, val, xType = xType)

From ewt@rpath.com Tue Jan  6 05:10:17 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n065AHYN024951
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 05:10:17 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n065AGWr007617
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:16 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n065AGsD002220
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:16 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n065AF4X003888
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 00:10:15 -0500
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n065AFpd003875
	for xobj-commits@lists.rpath.com; Tue, 6 Jan 2009 00:10:15 -0500
From: Erik Troan <ewt@rpath.com>
Message-Id: <200901060510.n065AFpd003875@scc.eng.rpath.com>
Date: Tue, 06 Jan 2009 00:10:15 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: branch merge
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 05:10:17 -0000

user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

branch merge

diff -r f5fdda96f29a -r 3967409a5087 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Mon Jan 05 10:57:49 2009 -0500
+++ b/py/test/xobjtest.py	Tue Jan 06 00:09:06 2009 -0500
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2008-2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
@@ -159,6 +159,95 @@
                       '</top>\n')
         self.assertEqual(o.toxml(), xmlOutText)
 
+    def testComplexListStrGen(self):
+        """
+        Test generating XML from a list of strings.
+        """
+
+        class Collection(object):
+            data = [ str ]
+        class DocumentClass(xobj.Document):
+            collection = Collection
+
+        collection = Collection()
+        collection.data = [ 'a', 'b', 'c', ]
+
+        xml = xobj.toxml(collection, 'collection')
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+        self.failUnlessEqual(collection.data, doc.collection.data)
+
+    def testComplexListObjGen(self):
+        """
+        Test generating XML from lists of objects.
+        """
+
+        class Basic(object):
+            foo = str
+        class BasicCollection(object):
+            data = [ Basic ]
+        class DocumentClass(xobj.Document):
+            collection = BasicCollection
+
+        basic = Basic()
+        basic.foo = 'a'
+
+        collection = BasicCollection()
+        collection.data = [ basic, ]
+
+        xml = xobj.toxml(collection, 'collection')
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+        self.failUnlessEqual(basic.foo, doc.collection.data[0].foo)
+
+    def testComplexDictStrGen(self):
+        """
+        Test generating XML from dictionaries of strings.
+        """
+
+        raise testhelp.SkipTestException('dicts not currently supported')
+
+        class Collection(object):
+            data = {str: str}
+        class DocumentClass(xobj.Document):
+            collection = Collection
+
+        collection = Collection()
+        collection.data = {'a': 'A'}
+
+        xml = xobj.toxml(collection, 'collection')
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+        self.failUnlessEqual(collection.data, doc.collection.data)
+
+    def testComplexDictObjGen(self):
+        """
+        Test generating XML from dictionaries of objects.
+        """
+
+        raise testhelp.SkipTestException('dicts not currently supported')
+
+        class Basic(object):
+            foo = str
+        class Collection(object):
+            data = {Basic: Basic}
+        class DocumentClass(xobj.Document):
+            collection = Collection
+
+        basicKey = Basic()
+        basicKey.foo = 'a'
+
+        basicVal = Basic()
+        basicVal.foo = 'A'
+
+        collection = Collection()
+        collection.data = {basicKey: basicVal}
+
+        xml = xobj.toxml(collection, 'collection')
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+
+        key = doc.collection.data.keys()[0]
+        val = doc.colleciton.data[key]
+
+        self.failUnlessEqual(key.foo, basicKey.foo)
+        self.failUnlessEqual(val.foo, basicVal.foo)
 
     def testNamespaces(self):
         xmlString = _xml('namespaces',
@@ -457,6 +546,7 @@
     def testIntElement(self):
         xml = _xml('intelement', '<top><anint>5</anint></top>')
         doc = xobj.parse(xml, typeMap = { 'anint' : int })
+        assert(doc.top.anint == 5)
 
     def testMetadataAttributeTypes(self):
         class Bar:
@@ -479,5 +569,65 @@
         s2 = d.toxml(xml_declaration = False)
         assert(s == s2)
 
+    def testSimpleMultiParse(self):
+        """
+        Test parsing multiple xml documents with one set of classes.
+        """
+
+        class Top(object):
+            foo = str
+        class DocumentClass(xobj.Document):
+            top = Top
+
+        topA = Top()
+        topA.foo = 'A'
+        xmlA = xobj.toxml(topA, 'top')
+
+        topB = Top()
+        topB.foo = 'B'
+        xmlB = xobj.toxml(topB, 'top')
+
+        docA = xobj.parse(xmlA, documentClass=DocumentClass)
+        docB = xobj.parse(xmlB, documentClass=DocumentClass)
+
+        self.failUnlessEqual('A', docA.top.foo)
+        self.failUnlessEqual('B', docB.top.foo)
+
+    def testComplexMultiParse(self):
+        """
+        Test parsing multiple xml documents with one set of classes using more
+        complex types.
+        """
+
+        class Top(object):
+            foo = [ str ]
+        class DocumentClass(xobj.Document):
+            top = Top
+
+        xmlTextA = _xml('complex',
+                       '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                       '<top>\n'
+                       '  <foo>a</foo>\n'
+                       '  <foo>b</foo>\n'
+                       '</top>\n')
+
+        xmlA = StringIO(xmlTextA)
+        docA = xobj.parsef(xmlA, documentClass=DocumentClass)
+
+        xmlTextB = _xml('complex',
+                       '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                       '<top>\n'
+                       '  <foo>A</foo>\n'
+                       '  <foo>B</foo>\n'
+                       '</top>\n')
+
+        xmlB = StringIO(xmlTextB)
+        docB = xobj.parsef(xmlB, documentClass=DocumentClass)
+
+        self.failUnlessEqual('a', docA.top.foo[0])
+        self.failUnlessEqual('b', docA.top.foo[1])
+        self.failUnlessEqual('A', docB.top.foo[0])
+        self.failUnlessEqual('B', docB.top.foo[1])
+
 if __name__ == "__main__":
     testsuite.main()
diff -r f5fdda96f29a -r 3967409a5087 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Mon Jan 05 10:57:49 2009 -0500
+++ b/py/xobj/xobj.py	Tue Jan 06 00:09:06 2009 -0500
@@ -219,7 +219,10 @@
                     attrs[key] = str(val)
                 else:
                     l = elements.setdefault(key, [])
-                    l.append(val)
+                    if type(val) == list:
+                        l.extend(val)
+                    else:
+                        l.append(val)
 
         orderedElements = []
 

From bmurphy@rpath.com Tue Jan  6 20:06:42 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n06K6gY6006807
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 20:06:42 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n06K6gYi001545
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 15:06:42 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n06K6gp6007000
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 15:06:42 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n06K6fTx029761
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 15:06:41 -0500
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n06K6fuk029742
	for xobj-commits@lists.rpath.com; Tue, 6 Jan 2009 15:06:41 -0500
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200901062006.n06K6fuk029742@scc.eng.rpath.com>
Date: Tue, 06 Jan 2009 15:06:41 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: hg ignore generated as3 files
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 20:06:43 -0000

user:        Brad Murphy <https://issues.rpath.com>
files:       .hgignore

hg ignore generated as3 files

diff -r c68a709aa5e5 -r 384356a0d5d7 .hgignore
--- a/.hgignore	Tue Jan 06 12:36:45 2009 -0500
+++ b/.hgignore	Tue Jan 06 15:06:11 2009 -0500
@@ -18,6 +18,7 @@
 *.bz2
 *.cache
 .*.swp
+*/generated
 
 .testerr
 */junit.xml

From bmurphy@rpath.com Tue Jan  6 20:06:44 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n06K6iH6006810
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 20:06:44 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n06K6iB0001550
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 15:06:44 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n06K6hrZ007004
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 15:06:44 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n06K6hZc029787
	for <xobj-commits@lists.rpath.com>; Tue, 6 Jan 2009 15:06:43 -0500
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n06K6gXp029782
	for xobj-commits@lists.rpath.com; Tue, 6 Jan 2009 15:06:42 -0500
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200901062006.n06K6gXp029782@scc.eng.rpath.com>
Date: Tue, 06 Jan 2009 15:06:42 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Support for building/running as3 test runners
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 06 Jan 2009 20:06:44 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       as3/Makefile as3/xobjas3-test/Makefile as3/xobjas3-test/Xvfb-wrapper.sh as3/xobjas3-test/build.properties as3/xobjas3-test/build.xml as3/xobjas3-test/libs/fluint-air.swc as3/xobjas3-test/src/TestConfiguration.as as3/xobjas3-test/src/TestRunner-app.xml as3/xobjas3-test/src/TestRunner.mxml as3/xobjas3-test/src/TestRunnerModules.mxml as3/xobjas3-test/src/TestSuites.as as3/xobjas3-test/src/WebTestRunner.mxml as3/xobjas3/Makefile as3/xobjas3/build.xml py/Makefile

Support for building/running as3 test runners

diff -r 384356a0d5d7 -r 11d97666ee3d as3/Makefile
--- a/as3/Makefile	Tue Jan 06 15:06:11 2009 -0500
+++ b/as3/Makefile	Tue Jan 06 15:06:46 2009 -0500
@@ -10,7 +10,7 @@
 # or fitness for a particular purpose. See the MIT License for full details.
 #
 
-SUBDIRS = xobjas3
+SUBDIRS = xobjas3 xobjas3-test
 
 
 build: default-build
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/Makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/Makefile	Tue Jan 06 15:06:46 2009 -0500
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
+
+build: default-build as-build
+
+install: default-install as-install
+
+clean: default-clean as-clean
+
+test: default-test as-test
+
+
+export TOPDIR=$(shell pwd)/../..
+include $(TOPDIR)/Make.rules
+include $(TOPDIR)/Make.defs
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/Xvfb-wrapper.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/Xvfb-wrapper.sh	Tue Jan 06 15:06:46 2009 -0500
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
+# This could probably be done more elegantly in Python...
+
+pid=''
+for ((d=0; d < 20; d++)); do
+    DISPLAY=:$d
+    Xvfb -ac $DISPLAY > /dev/null 2>&1 &
+    sleep 2
+    jobs -l %1 > /dev/null
+    pid=$(jobs -l %1 2>&1 | grep Running | awk '{print $2}')
+    if [ -z "$pid" ]; then
+        continue
+    fi
+    if ps $pid > /dev/null 2>&1; then
+        break
+    fi
+done
+
+if [ -z "$pid" ]; then
+    echo "unable to start Xvfb"
+    exit 1
+fi
+
+trap "kill -9 $pid" SIGINT SIGTERM EXIT
+
+export DISPLAY=$DISPLAY
+
+$*
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/build.properties
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/build.properties	Tue Jan 06 15:06:46 2009 -0500
@@ -0,0 +1,63 @@
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+#
+
+# Directories
+xobj.dir=../xobjas3/
+xobj.src.dir=${xobj.dir}/src
+xobj.build.dir=${xobj.dir}/bin
+xobj-test.dir=.
+xobj-test.src.dir=${xobj-test.dir}/src
+xobj-test.libs.dir=${xobj-test.dir}/libs
+xobj-test.build.dir=${xobj-test.dir}/bin-debug
+xobj-test.test.dir=${xobj-test.build.dir}/test
+xobj-test.test.output.dir=${xobj-test.test.dir}/output
+xobj-test.test.modules.dir=${xobj-test.test.dir}/modules
+
+# Testrunner vars
+xobj-test.testrunner.swf.name=TestRunner.swf
+xobj-test.testrunner.swf=${xobj-test.test.dir}/${xobj-test.testrunner.swf.name}
+xobj-test.testrunner.desc.name=TestRunner-app.xml
+xobj-test.testrunner.desc=${xobj-test.src.dir}/${xobj-test.testrunner.desc.name}
+xobj-test.testrunner.app.name=TestRunner.mxml
+xobj-test.testrunner.app=${xobj-test.src.dir}/${xobj-test.testrunner.app.name}
+xobj-test.testrunner.swf.width=800
+xobj-test.testrunner.swf.height=600
+
+# Test module variables
+xobj-test.modules.src.name=TestRunnerModules.mxml
+xobj-test.modules.src.file=${xobj-test.src.dir}/${xobj-test.modules.src.name}
+xobj-test.modules.swf.name=TestRunnerModules.swf
+xobj-test.modules.swf=${xobj-test.test.modules.dir}/${xobj-test.modules.swf.name}
+
+# Executables
+xobj-test.Xvnc-wrapper.cmd=${xobj-test.dir}/Xvfb-wrapper.sh
+
+# Flex vars
+FLEX_HOME=/opt/flex-sdk-3/
+flex.sdk.dir=${FLEX_HOME}
+flex.sdk.frameworks.dir=${flex.sdk.dir}/frameworks
+flex.sdk.frameworks.libs=${flex.sdk.frameworks.dir}/libs
+flex.sdk.ant.dir=${flex.sdk.dir}/ant
+flex.sdk.ant.lib=${flex.sdk.ant.dir}/lib
+flex.sdk.ant.flextasks.jar=${flex.sdk.ant.lib}/flexTasks.jar
+flex.sdk.flashlib.version=9
+flex.sdk.flashlib.name=playerglobal.swc
+flex.sdk.flashlib=${flex.sdk.frameworks.libs}/player/${flex.sdk.flashlib.version}/${flex.sdk.flashlib.name}
+flex-config.name=flex-config.xml
+
+# AIR related vars
+air.sdk.dir=/opt/air-sdk
+air.sdk.runner=adl
+air.sdk.bin.dir=${air.sdk.dir}/bin
+air.sdk.lib.dir=${flex.sdk.frameworks.libs}/air
+air.sdk.frameworks.dir=${air.sdk.lib.dir}
+air.sdk.runtime.dir=${air.sdk.dir}/runtime
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/build.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/build.xml	Tue Jan 06 15:06:46 2009 -0500
@@ -0,0 +1,153 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright (c) 2008 rPath, Inc.
+
+ This program is distributed under the terms of the MIT License as found 
+ in a file called LICENSE. If it is not present, the license
+ is always available at http://www.opensource.org/licenses/mit-license.php.
+
+ This program is distributed in the hope that it will be useful, but
+ without any waranty; without even the implied warranty of merchantability
+ or fitness for a particular purpose. See the MIT License for full details.
+-->
+
+<project basedir="." default="dist" name="xobj-test">
+    
+    <!-- Load user's property file to override settings -->
+    <property file="user.properties"/>
+    
+    <!-- Load our property file -->
+    <property file="build.properties"/>
+    
+    <!-- Include support for Flex ant tasks -->
+    <taskdef resource="flexTasks.tasks" classpath="${flex.sdk.ant.flextasks.jar}"/>
+	
+    <target name="clean" description="Clean for building">
+    	<echo>Cleaning xobj-test</echo>
+        <delete includeemptydirs="true" quiet="true">
+        	<fileset dir="${xobj-test.build.dir}">
+                <include name="**/*"/>
+            </fileset>
+        </delete>
+    	<echo>Cleaning completed</echo>
+    </target>
+	
+	<target name="test-clean" description="Clean for testing">
+        <echo>Cleaning xobj-test testing environment</echo>
+        <delete includeemptydirs="true" quiet="true">
+            <fileset dir="${xobj-test.output.dir}">
+                <include name="**/*"/>
+            </fileset>
+        </delete>
+        <echo>Cleaning completed</echo>
+    </target>
+	    
+    <target name="init" description="Initialization for testing">
+    	<mkdir dir="${xobj-test.test.output.dir}" />
+    	<mkdir dir="${xobj-test.test.modules.dir}" />
+    </target>
+	
+	<!-- Build the test modules -->
+	<target name="testrunner-modules-build" description="Build the test modules">
+		<echo>Building testrunner modules</echo>
+        <mxmlc file="${xobj-test.modules.src.file}" output="${xobj-test.modules.swf}" 
+            actionscript-file-encoding="UTF-8" keep-generated-actionscript="true"
+            incremental="true" debug="true">
+            
+            <!-- Get default compiler options. -->
+            <load-config filename="${flex.sdk.frameworks.dir}/${flex-config.name}"/>
+    
+            <!-- List of path elements that form the roots of ActionScript
+            class hierarchies. -->
+            <source-path path-element="${flex.sdk.frameworks.dir}"/>
+            <source-path path-element="${xobj-test.src.dir}"/>
+        	<source-path path-element="${xobj.src.dir}"/>
+    
+            <!-- List of SWC files or directories that contain SWC files. -->
+            <library-path dir="${flex.sdk.frameworks.libs}" append="true">
+                <include name="**/*.swc" />
+                <exclude name="**/${flex.sdk.flashlib.name}"/>
+                <exclude name="air/*" />
+            </library-path>
+            <library-path file="${flex.sdk.flashlib}" append="true"/>
+            <library-path dir="${xobj.build.dir}" append="true">
+                <include name="**/*.swc" />
+            </library-path>
+        	<library-path dir="${xobj-test.libs.dir}" append="true">
+                <include name="**/*.swc" />
+            </library-path>
+    
+        </mxmlc>
+        <echo>Build completed</echo>
+    </target>
+	
+	<!-- Build the testrunner -->
+	<target name="testrunner-build" description="Build the TestRunner swf">
+		<echo>Building testrunner</echo>
+        <mxmlc file="${xobj-test.testrunner.app}" output="${xobj-test.testrunner.swf}" 
+            actionscript-file-encoding="UTF-8" keep-generated-actionscript="true"
+            incremental="true" debug="true">
+            
+            <!-- Get default compiler options. -->
+            <load-config filename="${flex.sdk.frameworks.dir}/${flex-config.name}"/>
+    
+            <!-- List of path elements that form the roots of ActionScript
+            class hierarchies. -->
+            <source-path path-element="${flex.sdk.frameworks.dir}"/>
+        	<source-path path-element="${xobj-test.src.dir}"/>
+        	<source-path path-element="${xobj.src.dir}"/>
+    
+            <!-- List of SWC files or directories that contain SWC files. -->
+            <library-path dir="${flex.sdk.frameworks.libs}" append="true">
+                <include name="**/*.swc" />
+                <exclude name="**/${flex.sdk.flashlib.name}"/>
+                <exclude name="air/*" />
+            </library-path>
+            <library-path file="${flex.sdk.flashlib}" append="true"/>
+        	<library-path dir="${xobj.build.dir}" append="true">
+                <include name="**/*.swc" />
+            </library-path>
+            <include-libraries dir="${air.sdk.lib.dir}" append="true">
+                <include name="**/*.swc" />
+            </include-libraries>
+        	<library-path dir="${xobj-test.libs.dir}" append="true">
+                <include name="**/*.swc" />
+            </library-path>
+    
+            <!-- Set size of output SWF file. -->
+            <default-size width="${xobj-test.testrunner.swf.width}" height="${xobj-test.testrunner.swf.height}" />
+        </mxmlc>
+        <copy todir="${xobj-test.test.dir}">
+            <fileset dir="${xobj-test.src.dir}">
+                <include name="${xobj-test.testrunner.desc.name}"/>
+            </fileset>
+        </copy>
+        <echo>Build complete</echo>
+    </target>
+	
+	<target name="build" description="Build everything">
+        <!-- Clean up build environment -->
+        <antcall target="clean"/>
+        <antcall target="init"/>
+        
+        <!-- Build everything -->
+        <antcall target="testrunner-modules-build"/>
+		<antcall target="testrunner-build"/>
+    </target>
+	
+	<!-- Targets for testing -->
+	<target name="test" description="Run automated tests">
+        <antcall target="test-clean"/>
+        <exec executable="${xobj-test.Xvnc-wrapper.cmd}">
+            <arg line="${air.sdk.bin.dir}/${air.sdk.runner} ${xobj-test.test.dir}/TestRunner-app.xml -- -headless -reportDir=${basedir}/${xobj-test.test.output.dir} -fileSet=${basedir}/${xobj-test.test.modules.dir}"/>
+        </exec>
+    </target>
+    
+    <!-- Target to do a clean build then run any tests -->
+    <target name="dist" description="Perform a full build and run any tests">
+        <antcall target="build"/>
+    	<antcall target="auto-test"/>
+    </target>
+    
+</project>
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/libs/fluint-air.swc
Binary file as3/xobjas3-test/libs/fluint-air.swc has changed
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/src/TestConfiguration.as
--- a/as3/xobjas3-test/src/TestConfiguration.as	Tue Jan 06 15:06:11 2009 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-#
-# Copyright (c) 2008 rPath, Inc.
-#
-# This program is distributed under the terms of the MIT License as found 
-# in a file called LICENSE. If it is not present, the license
-# is always available at http://www.opensource.org/licenses/mit-license.php.
-#
-# This program is distributed in the hope that it will be useful, but
-# without any waranty; without even the implied warranty of merchantability
-# or fitness for a particular purpose. See the MIT License for full details.
-*/
-
-package
-{
-    
-    /** 
-     * TestConfiguration is a static helper class that
-     * returns the array of test suites to execute
-     */
-    
-    public class TestConfiguration
-    {
-        
-        public static function suites() : Array
-        {
-            var suiteArray:Array = new Array();
-    
-            suiteArray.push( new TestSuite1() );
-            //suiteArray.push( new ControllerTestSuite() );
-            
-            return suiteArray;
-        }
-    }
-}
\ No newline at end of file
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/src/TestRunner-app.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/TestRunner-app.xml	Tue Jan 06 15:06:46 2009 -0500
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2008 rPath, Inc.
+
+ This program is distributed under the terms of the MIT License as found 
+ in a file called LICENSE. If it is not present, the license
+ is always available at http://www.opensource.org/licenses/mit-license.php.
+
+ This program is distributed in the hope that it will be useful, but
+ without any waranty; without even the implied warranty of merchantability
+ or fitness for a particular purpose. See the MIT License for full details.
+-->
+<application xmlns="http://ns.adobe.com/air/application/1.0">
+
+<!-- Adobe AIR Application Descriptor File Template.
+
+	Specifies parameters for identifying, installing, and launching AIR applications.
+	See http://www.adobe.com/go/air_1.0_application_descriptor for complete documentation.
+
+	xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/1.0
+			The last segment of the namespace specifies the version 
+			of the AIR runtime required for this application to run.
+			
+	minimumPatchLevel - The minimum patch level of the AIR runtime required to run 
+			the application. Optional.
+-->
+
+	<!-- The application identifier string, unique to this application. Required. -->
+	<id>com.rpath.xobj.TestRunner</id>
+
+	<!-- Used as the filename for the application. Required. -->
+	<filename>TestRunner</filename>
+
+	<!-- The name that is displayed in the AIR application installer. Optional. -->
+	<name>TestRunner</name>
+
+	<!-- An application version designator (such as "v1", "2.5", or "Alpha 1"). Required. -->
+	<version>1.0.0</version>
+
+	<!-- Description, displayed in the AIR application installer. Optional. -->
+	<!-- <description></description> -->
+
+	<!-- Copyright information. Optional -->
+	<!-- <copyright></copyright> -->
+
+	<!-- Settings for the application's initial window. Required. -->
+	<initialWindow>
+		<!-- The main SWF or HTML file of the application. Required. -->
+		<!-- Note: In Flex Builder, the SWF reference is set automatically. -->
+		<content>TestRunner.swf</content>
+		
+		<!-- The title of the main window. Optional. -->
+		<!-- <title></title> -->
+
+		<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
+		<!-- <systemChrome></systemChrome> -->
+
+		<!-- Whether the window is transparent. Only applicable when systemChrome is false. Optional. Default false. -->
+		<!-- <transparent></transparent> -->
+
+		<!-- Whether the window is initially visible. Optional. Default false. -->
+		<visible>true</visible>
+
+		<!-- Whether the user can minimize the window. Optional. Default true. -->
+		<!-- <minimizable></minimizable> -->
+
+		<!-- Whether the user can maximize the window. Optional. Default true. -->
+		<!-- <maximizable></maximizable> -->
+
+		<!-- Whether the user can resize the window. Optional. Default true. -->
+		<!-- <resizable></resizable> -->
+
+		<!-- The window's initial width. Optional. -->
+		<!-- <width></width> -->
+
+		<!-- The window's initial height. Optional. -->
+		<!-- <height></height> -->
+
+		<!-- The window's initial x position. Optional. -->
+		<!-- <x></x> -->
+
+		<!-- The window's initial y position. Optional. -->
+		<!-- <y></y> -->
+
+		<!-- The window's minimum size, specified as a width/height pair, such as "400 200". Optional. -->
+		<!-- <minSize></minSize> -->
+
+		<!-- The window's initial maximum size, specified as a width/height pair, such as "1600 1200". Optional. -->
+		<!-- <maxSize></maxSize> -->
+	</initialWindow>
+
+	<!-- The subpath of the standard default installation location to use. Optional. -->
+	<!-- <installFolder></installFolder> -->
+
+	<!-- The subpath of the Windows Start/Programs menu to use. Optional. -->
+	<!-- <programMenuFolder></programMenuFolder> -->
+
+	<!-- The icon the system uses for the application. For at least one resolution,
+		 specify the path to a PNG file included in the AIR package. Optional. -->
+	<!-- <icon>
+		<image16x16></image16x16>
+		<image32x32></image32x32>
+		<image48x48></image48x48>
+		<image128x128></image128x128>
+	</icon> -->
+
+	<!-- Whether the application handles the update when a user double-clicks an update version
+	of the AIR file (true), or the default AIR application installer handles the update (false).
+	Optional. Default false. -->
+	<!-- <customUpdateUI></customUpdateUI> -->
+	
+	<!-- Whether the application can be launched when the user clicks a link in a web browser.
+	Optional. Default false. -->
+	<!-- <allowBrowserInvocation></allowBrowserInvocation> -->
+
+	<!-- Listing of file types for which the application can register. Optional. -->
+	<!-- <fileTypes> -->
+
+		<!-- Defines one file type. Optional. -->
+		<!-- <fileType> -->
+
+			<!-- The name that the system displays for the registered file type. Required. -->
+			<!-- <name></name> -->
+
+			<!-- The extension to register. Required. -->
+			<!-- <extension></extension> -->
+			
+			<!-- The description of the file type. Optional. -->
+			<!-- <description></description> -->
+			
+			<!-- The MIME type. Optional. -->
+			<!-- <contentType></contentType> -->
+			
+			<!-- The icon to display for the file type. Optional. -->
+			<!-- <icon>
+				<image16x16></image16x16>
+				<image32x32></image32x32>
+				<image48x48></image48x48>
+				<image128x128></image128x128>
+			</icon> -->
+			
+		<!-- </fileType> -->
+	<!-- </fileTypes> -->
+
+</application>
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/src/TestRunner.mxml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/TestRunner.mxml	Tue Jan 06 15:06:46 2009 -0500
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (c) 2008 rPath, Inc.
+
+ This program is distributed under the terms of the MIT License as found 
+ in a file called LICENSE. If it is not present, the license
+ is always available at http://www.opensource.org/licenses/mit-license.php.
+
+ This program is distributed in the hope that it will be useful, but
+ without any waranty; without even the implied warranty of merchantability
+ or fitness for a particular purpose. See the MIT License for full details.
+-->
+<fluint:TestRunnerWindow 
+    xmlns="*"
+    xmlns:mx="http://www.adobe.com/2006/mxml" 
+    xmlns:fluint="http://www.digitalprimates.net/2008/fluint"
+    width="100%" height="100%"
+    layout="absolute"
+    >
+
+    <mx:Script>
+    <![CDATA[
+    ]]>
+    </mx:Script>
+
+</fluint:TestRunnerWindow>
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/src/TestRunnerModules.mxml
--- a/as3/xobjas3-test/src/TestRunnerModules.mxml	Tue Jan 06 15:06:11 2009 -0500
+++ b/as3/xobjas3-test/src/TestRunnerModules.mxml	Tue Jan 06 15:06:46 2009 -0500
@@ -17,7 +17,7 @@
     <![CDATA[
     import net.digitalprimates.fluint.unitTests.frameworkSuite.FrameworkSuite;
     public function getTestSuites():Array {
-        return TestConfiguration.suites()
+        return TestSuites.suites()
     }
     ]]>
     </mx:Script>    
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/src/TestSuites.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/TestSuites.as	Tue Jan 06 15:06:46 2009 -0500
@@ -0,0 +1,34 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package
+{
+    
+    /** 
+     * TestSuites is a static helper class that
+     * returns the array of test suites to execute
+     */
+    
+    public class TestSuites
+    {
+        
+        public static function suites() : Array
+        {
+            var suiteArray:Array = new Array();
+    
+            suiteArray.push(new TestSuite1());
+            
+            return suiteArray;
+        }
+    }
+}
\ No newline at end of file
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3-test/src/WebTestRunner.mxml
--- a/as3/xobjas3-test/src/WebTestRunner.mxml	Tue Jan 06 15:06:11 2009 -0500
+++ b/as3/xobjas3-test/src/WebTestRunner.mxml	Tue Jan 06 15:06:46 2009 -0500
@@ -25,8 +25,7 @@
 
     protected function startTestProcess( event:Event ):void 
     {
-        // run RAF tests here too since lib projects can't have a web test runner
-        var suites:Array = TestConfiguration.suites();
+        var suites:Array = TestSuites.suites();
         testRunner.startTests(suites);
     }
 
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3/Makefile
--- a/as3/xobjas3/Makefile	Tue Jan 06 15:06:11 2009 -0500
+++ b/as3/xobjas3/Makefile	Tue Jan 06 15:06:46 2009 -0500
@@ -16,7 +16,7 @@
 
 clean: default-clean as-clean
 
-test: default-test as-test
+test: default-test
 
 
 export TOPDIR=$(shell pwd)/../..
diff -r 384356a0d5d7 -r 11d97666ee3d as3/xobjas3/build.xml
--- a/as3/xobjas3/build.xml	Tue Jan 06 15:06:11 2009 -0500
+++ b/as3/xobjas3/build.xml	Tue Jan 06 15:06:46 2009 -0500
@@ -111,20 +111,10 @@
         <!-- Build the lib -->
     	<antcall target="xobj-build"/>
     </target>
-	
-	<!-- Targets for testing -->
-	<target name="test" description="Run automated tests">
-        <antcall target="test-clean"/>
-        <exec executable="${flexlibs-build.test.Xvnc-wrapper.cmd}">
-            <arg line="${air.sdk.bin.dir}/${air.sdk.runner} ${flexlibs-build.test.dir}/TestRunner-app.xml -- -headless -reportDir=${basedir}/${flexlibs-build.test.output.dir} -fileSet=${basedir}/${flexlibs-build.test.modules.dir}"/>
-        </exec>
-        <move file="${flexlibs-build.test.output.dir}/${flexlibs.testrunner.report}" tofile="${flexlibs-build.test.output.dir}/junit.xml"/>
-    </target>
     
     <!-- Target to do a clean build then run any tests -->
     <target name="dist" description="Perform a full build and run any tests">
         <antcall target="build"/>
-    	<antcall target="auto-test"/>
     </target>
     
 </project>
diff -r 384356a0d5d7 -r 11d97666ee3d py/Makefile
--- a/py/Makefile	Tue Jan 06 15:06:11 2009 -0500
+++ b/py/Makefile	Tue Jan 06 15:06:46 2009 -0500
@@ -10,7 +10,7 @@
 # or fitness for a particular purpose. See the MIT License for full details.
 #
 
-SUBDIRS = xobj test
+SUBDIRS = xobj #test
 
 
 build: default-build

From elliot@rpath.com Fri Jan  9 15:24:31 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n09FOVjr030935
	for <xobj-commits@lists.rpath.com>; Fri, 9 Jan 2009 15:24:31 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n09FOVAp019137
	for <xobj-commits@lists.rpath.com>; Fri, 9 Jan 2009 10:24:31 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n09FOVG7010274
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 9 Jan 2009 10:24:31 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n09FOUwj010827
	for <xobj-commits@lists.rpath.com>; Fri, 9 Jan 2009 10:24:30 -0500
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n09FOUPh010812
	for xobj-commits@lists.rpath.com; Fri, 9 Jan 2009 10:24:30 -0500
From: Elliot Peele <elliot@rpath.com>
Message-Id: <200901091524.n09FOUPh010812@scc.eng.rpath.com>
Date: Fri, 09 Jan 2009 10:24:30 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: add tests for None type handling
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 09 Jan 2009 15:24:31 -0000

user:        Elliot Peele <https://issues.rpath.com/>
files:       py/test/xobjtest.py

add tests for None type handling

diff -r 18270f9a37a5 -r b5c0338717f9 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Tue Jan 06 00:10:00 2009 -0500
+++ b/py/test/xobjtest.py	Fri Jan 09 10:23:06 2009 -0500
@@ -511,6 +511,7 @@
         t.prop = 'abc'
         t.middle = Middle()
         t.middle.tag = 123
+        t.bottom = None
 
         s = xobj.toxml(t, 'top', xml_declaration = False)
         self.assertEquals(s, '<top>\n'
@@ -629,5 +630,97 @@
         self.failUnlessEqual('A', docB.top.foo[0])
         self.failUnlessEqual('B', docB.top.foo[1])
 
+    def testNoneSingleElementSerialization(self):
+        """
+        Test serializing a single element set to None.
+        """
+
+        class Top(object):
+            foo = str
+        class DocumentClass(xobj.Document):
+            top = Top
+
+        top = Top()
+        top.foo = None
+
+        xml = xobj.toxml(top, 'top')
+        expectedXml = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                       '<top/>\n')
+        self.failUnlessEqual(xml, expectedXml)
+
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+        self.failUnlessEqual(top.foo, doc.top.foo)
+
+    def testNoneMultiElementSerialization(self):
+        """
+        Test serializing multiple elements that are set to None.
+        """
+
+        class Top(object):
+            foo = str
+            bar = str
+        class DocumentClass(xobj.Document):
+            top = Top
+
+        top = Top()
+        top.foo = None
+        top.bar = ''
+
+        xml = xobj.toxml(top, 'top')
+        expectedXml = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                       '<top>\n'
+                       '  <bar></bar>\n'
+                       '</top>\n')
+        self.failUnlessEqual(xml, expectedXml)
+
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+        self.failUnlessEqual(top.foo, doc.top.foo)
+        self.failUnlessEqual(top.bar, doc.top.bar)
+
+    def testNoneSingleAttributeSerialization(self):
+        """
+        Test serializing a single attribute that is set to None.
+        """
+
+        class Top(object):
+            _xobj = xobj.XObjMetadata(attributes=['foo'])
+        class DocumentClass(xobj.Document):
+            top = Top
+
+        top = Top()
+        top.foo = None
+
+        xml = xobj.toxml(top, 'top')
+        expectedXml = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                       '<top/>\n')
+        self.failUnlessEqual(xml, expectedXml)
+
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+        self.failUnlessEqual(top.foo, doc.top.foo)
+
+    def testNoneMultiAttributeSerialization(self):
+        """
+        Test serializing multiple attributes that are set to None.
+        """
+
+        class Top(object):
+            _xobj = xobj.XObjMetadata(attributes=['foo', 'bar'])
+        class DocumentClass(xobj.Document):
+            top = Top
+
+        top = Top()
+        top.foo = None
+        top.bar = ''
+
+        xml = xobj.toxml(top, 'top')
+        expectedXml = ('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                       '<top bar=""/>\n')
+        self.failUnlessEqual(xml, expectedXml)
+
+        doc = xobj.parse(xml, documentClass=DocumentClass)
+        self.failUnlessEqual(top.foo, doc.top.foo)
+        self.failUnlessEqual(top.bar, doc.top.bar)
+
+
 if __name__ == "__main__":
     testsuite.main()

From elliot@rpath.com Sun Jan 11 22:54:57 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by localhost.localdomain (8.13.7/8.13.7) with ESMTP id n0BMsvk3013580
	for <xobj-commits@lists.rpath.com>; Sun, 11 Jan 2009 22:54:57 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n0BMsum0031403
	for <xobj-commits@lists.rpath.com>; Sun, 11 Jan 2009 17:54:56 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n0BMsuWM017143
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Sun, 11 Jan 2009 17:54:56 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n0BMsuYx028279
	for <xobj-commits@lists.rpath.com>; Sun, 11 Jan 2009 17:54:56 -0500
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n0BMsux0028263
	for xobj-commits@lists.rpath.com; Sun, 11 Jan 2009 17:54:56 -0500
From: Elliot Peele <elliot@rpath.com>
Message-Id: <200901112254.n0BMsux0028263@scc.eng.rpath.com>
Date: Sun, 11 Jan 2009 17:54:56 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: add support for None type handling
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Sun, 11 Jan 2009 22:54:57 -0000

user:        Elliot Peele <https://issues.rpath.com/>
files:       py/xobj/xobj.py

add support for None type handling

diff -r b5c0338717f9 -r 33fc95c3e55a py/xobj/xobj.py
--- a/py/xobj/xobj.py	Fri Jan 09 10:23:06 2009 -0500
+++ b/py/xobj/xobj.py	Sun Jan 11 17:43:42 2009 -0500
@@ -161,6 +161,9 @@
 
             return s
 
+        if xobj is None:
+            return
+
         if type(xobj) == int:
             xobj = str(xobj)
 
@@ -215,8 +218,9 @@
                           (pythonType and issubclass(pythonType, XID))):
                         self.idsFound.add(val)
 
-                    key = addns(key)
-                    attrs[key] = str(val)
+                    if val is not None:
+                        key = addns(key)
+                        attrs[key] = str(val)
                 else:
                     l = elements.setdefault(key, [])
                     if type(val) == list:
@@ -278,7 +282,6 @@
     typeMap = {}
 
     def __init__(self, schema = None):
-        XObj.__init__(self)
         self._idsNeeded = []
         self._dynamicClassDict = {}
         self._ids = {}
@@ -338,7 +341,6 @@
                     doc._ids[val] = xobj
 
                 expectedXType = None
-                val = XObj(val)
 
             addAttribute(xobj, key, val, xType = expectedXType)
 
@@ -455,6 +457,16 @@
                 key = nsmap(key)
                 setAttribute(xobj, self, key, val)
 
+            # Backfill any attributes that were not in the XML with None.
+            for key, val in xobj._xobj.attributes.iteritems():
+                key = nsmap(key)
+                # Do not backfill values that are XIDREFs, they will be
+                # handled later.
+                if val is not None and issubclass(val, XIDREF):
+                    continue
+                if not hasattr(xobj, key):
+                    setAttribute(xobj, self, key, val)
+
             # anything which is the same as in the class wasn't set in XML, so
             # set it to None
             for key, val in xobj.__class__.__dict__.items():

From dbc@rpath.com Thu Feb 12 10:55:37 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n1CFtbOD015978
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 15:55:37 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n1CFtaCQ029147
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 10:55:36 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n1CFtaEA027449
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 10:55:36 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n1CFtaeG025143
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 10:55:36 -0500
Received: (from dbc@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n1CFtasJ025138
	for xobj-commits@lists.rpath.com; Thu, 12 Feb 2009 10:55:36 -0500
From: David Christian <dbc@rpath.com>
Message-Id: <200902121555.n1CFtasJ025138@scc.eng.rpath.com>
Date: Thu, 12 Feb 2009 10:55:36 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Add support for floats.
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 12 Feb 2009 15:55:37 -0000

tag:         tip
user:        David Christian <http://issues.rpath.com>
files:       py/xobj/xobj.py

Add support for floats.

diff -r e0bec4676114 -r 2b897947cfaa py/xobj/xobj.py
--- a/py/xobj/xobj.py	Sun Jan 11 22:54:22 2009 +0000
+++ b/py/xobj/xobj.py	Thu Feb 12 10:55:32 2009 -0500
@@ -66,6 +66,8 @@
         return XType(XObj)
     elif xObjectType == int:
         return XType(XObjInt)
+    elif xObjectType == float:
+        return XType(XObjFloat)
     elif type(xObjectType) == list:
         assert(len(xObjectType) == 1)
         return XType(XTypeFromXObjectType(xObjectType[0]).pythonType,
@@ -108,7 +110,9 @@
             return object.__repr__(self)
 
 class XObjInt(int):
+    pass
 
+class XObjFloat(float):
     pass
 
 class XObjMetadata(object):
@@ -164,7 +168,7 @@
         if xobj is None:
             return
 
-        if type(xobj) == int:
+        if type(xobj) in (int, float):
             xobj = str(xobj)
 
         if type(xobj) == str:

From elliot@rpath.com Thu Feb 12 12:31:07 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n1CHV7Em016275
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 17:31:07 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n1CHV7rI002526
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 12:31:07 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n1CHV7xY002972
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 12:31:07 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n1CHV6ao028757
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 12:31:06 -0500
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n1CHV6EJ028752
	for xobj-commits@lists.rpath.com; Thu, 12 Feb 2009 12:31:06 -0500
From: Elliot Peele <elliot@rpath.com>
Message-Id: <200902121731.n1CHV6EJ028752@scc.eng.rpath.com>
Date: Thu, 12 Feb 2009 12:31:06 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: re-enable the python testsuite
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 12 Feb 2009 17:31:08 -0000

tag:         tip
user:        Elliot Peele <https://issues.rpath.com/>
files:       py/Makefile

re-enable the python testsuite

diff -r 2b897947cfaa -r 180b2eb93cd1 py/Makefile
--- a/py/Makefile	Thu Feb 12 10:55:32 2009 -0500
+++ b/py/Makefile	Thu Feb 12 12:30:27 2009 -0500
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2008-2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
@@ -10,7 +10,7 @@
 # or fitness for a particular purpose. See the MIT License for full details.
 #
 
-SUBDIRS = xobj #test
+SUBDIRS = xobj test
 
 
 build: default-build

From elliot@rpath.com Thu Feb 12 13:04:35 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n1CI4YMK016376
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 18:04:34 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n1CI4YPZ003944
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 13:04:34 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n1CI4YwF005093
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 13:04:34 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n1CI4YHF030007
	for <xobj-commits@lists.rpath.com>; Thu, 12 Feb 2009 13:04:34 -0500
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n1CI4X6N030002
	for xobj-commits@lists.rpath.com; Thu, 12 Feb 2009 13:04:33 -0500
From: Elliot Peele <elliot@rpath.com>
Message-Id: <200902121804.n1CI4X6N030002@scc.eng.rpath.com>
Date: Thu, 12 Feb 2009 13:04:33 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: use /usr/bin/python
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 12 Feb 2009 18:04:35 -0000

tag:         tip
user:        Elliot Peele <https://issues.rpath.com/>
files:       Make.rules

use /usr/bin/python

diff -r 180b2eb93cd1 -r e3d9c19f3ea2 Make.rules
--- a/Make.rules	Thu Feb 12 12:30:27 2009 -0500
+++ b/Make.rules	Thu Feb 12 13:04:17 2009 -0500
@@ -57,7 +57,7 @@
 
 
 # Python rules
-PYTHON = $(shell [ -x /usr/bin/python2.4 ] && echo /usr/bin/python2.4)
+PYTHON = $(shell [ -x /usr/bin/python ] && echo /usr/bin/python)
 PYVERSION = $(shell $(PYTHON) -c 'import os, sys; print sys.version[:3]')
 PYINCLUDE = $(shell $(PYTHON) -c 'import os, sys; print os.sep.join((sys.prefix, "include", "python" + sys.version[:3]))')
 

From dbc@rpath.com Mon Feb 23 10:10:42 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n1NFAgfi001464
	for <xobj-commits@lists.rpath.com>; Mon, 23 Feb 2009 15:10:42 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n1NFAgi3009644
	for <xobj-commits@lists.rpath.com>; Mon, 23 Feb 2009 10:10:42 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n1NFAfum032221
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 23 Feb 2009 10:10:42 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n1NFAfZA026305
	for <xobj-commits@lists.rpath.com>; Mon, 23 Feb 2009 10:10:41 -0500
Received: (from dbc@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n1NFAe7L026300
	for xobj-commits@lists.rpath.com; Mon, 23 Feb 2009 10:10:40 -0500
From: David Christian <dbc@rpath.com>
Message-Id: <200902231510.n1NFAe7L026300@scc.eng.rpath.com>
Date: Mon, 23 Feb 2009 10:10:40 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Add ability to specify both attributes and text.
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 23 Feb 2009 15:10:43 -0000

tag:         tip
user:        David Christian <http://issues.rpath.com>
files:       py/xobj/xobj.py

Add ability to specify both attributes and text.

diff -r e3d9c19f3ea2 -r f2300a13c777 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Thu Feb 12 13:04:17 2009 -0500
+++ b/py/xobj/xobj.py	Mon Feb 23 10:10:32 2009 -0500
@@ -75,7 +75,7 @@
 
     return XType(xObjectType)
 
-class XObj(str):
+class XObj(object):
 
     """
     Example class for all elements represented in XML. Subclasses of XObject
@@ -117,9 +117,9 @@
 
 class XObjMetadata(object):
 
-    __slots__ = [ 'elements', 'attributes', 'tag' ]
+    __slots__ = [ 'elements', 'attributes', 'tag', 'text' ]
 
-    def __init__(self, elements = None, attributes = None):
+    def __init__(self, elements = None, attributes = None, text = None):
         if elements:
             self.elements = list(elements)
         else:
@@ -134,6 +134,7 @@
             self.attributes = dict()
 
         self.tag = None
+        self.text = text
 
 class XID(XObj):
 
@@ -249,8 +250,13 @@
         else:
             element = etree.SubElement(parentElement, tag, attrs)
 
+
         if isinstance(xobj, str) and xobj:
             element.text = str(xobj)
+        elif xobj._xobj.text and not orderedElements:
+            # only add text if we don't have elements
+            # can't have both.
+            element.text = xobj._xobj.text
 
         for key, val in orderedElements:
             if val is not None:

From dbc@rpath.com Tue Mar  3 22:52:49 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n243qnJg009759
	for <xobj-commits@lists.rpath.com>; Wed, 4 Mar 2009 03:52:49 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n243qnHX013341
	for <xobj-commits@lists.rpath.com>; Tue, 3 Mar 2009 22:52:49 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n243qnE8025553
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 3 Mar 2009 22:52:49 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n243qmXv032742
	for <xobj-commits@lists.rpath.com>; Tue, 3 Mar 2009 22:52:48 -0500
Received: (from dbc@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n243qm2a032736
	for xobj-commits@lists.rpath.com; Tue, 3 Mar 2009 22:52:48 -0500
From: David Christian <dbc@rpath.com>
Message-Id: <200903040352.n243qm2a032736@scc.eng.rpath.com>
Date: Tue, 03 Mar 2009 22:52:48 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: try to fix xobj
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 04 Mar 2009 03:52:50 -0000

tag:         tip
user:        David Christian <http://issues.rpath.com>
files:       py/xobj/xobj.py

try to fix xobj

diff -r f2300a13c777 -r 51b0df61076a py/xobj/xobj.py
--- a/py/xobj/xobj.py	Mon Feb 23 10:10:32 2009 -0500
+++ b/py/xobj/xobj.py	Tue Mar 03 22:52:41 2009 -0500
@@ -253,7 +253,8 @@
 
         if isinstance(xobj, str) and xobj:
             element.text = str(xobj)
-        elif xobj._xobj.text and not orderedElements:
+        elif (hasattr(xobj, '_xobj') and xobj._xobj.text 
+              and not orderedElements):
             # only add text if we don't have elements
             # can't have both.
             element.text = xobj._xobj.text

From dbc@rpath.com Wed Mar  4 09:11:32 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n24EBW66011761
	for <xobj-commits@lists.rpath.com>; Wed, 4 Mar 2009 14:11:32 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n24EBVVX002376
	for <xobj-commits@lists.rpath.com>; Wed, 4 Mar 2009 09:11:31 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n24EBVRI024476
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 4 Mar 2009 09:11:31 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n24EBUpU014917
	for <xobj-commits@lists.rpath.com>; Wed, 4 Mar 2009 09:11:31 -0500
Received: (from dbc@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n24EBU2u014912
	for xobj-commits@lists.rpath.com; Wed, 4 Mar 2009 09:11:30 -0500
From: David Christian <dbc@rpath.com>
Message-Id: <200903041411.n24EBU2u014912@scc.eng.rpath.com>
Date: Wed, 04 Mar 2009 09:11:30 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: return XObj to subclassing from str.
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 04 Mar 2009 14:11:32 -0000

tag:         tip
user:        David Christian <http://issues.rpath.com>
files:       py/xobj/xobj.py

return XObj to subclassing from str.

diff -r 51b0df61076a -r 37d2e9009b1d py/xobj/xobj.py
--- a/py/xobj/xobj.py	Tue Mar 03 22:52:41 2009 -0500
+++ b/py/xobj/xobj.py	Wed Mar 04 09:11:22 2009 -0500
@@ -75,7 +75,7 @@
 
     return XType(xObjectType)
 
-class XObj(object):
+class XObj(str):
 
     """
     Example class for all elements represented in XML. Subclasses of XObject

From bpja@rpath.com Thu Mar  5 01:10:10 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n256AAEF014925
	for <xobj-commits@lists.rpath.com>; Thu, 5 Mar 2009 06:10:10 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n256AAIv001642
	for <xobj-commits@lists.rpath.com>; Thu, 5 Mar 2009 01:10:10 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n256AAqS010036
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 5 Mar 2009 01:10:10 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n256A96v008623
	for <xobj-commits@lists.rpath.com>; Thu, 5 Mar 2009 01:10:09 -0500
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n256A9vM008617
	for xobj-commits@lists.rpath.com; Thu, 5 Mar 2009 01:10:09 -0500
From: Brett Adam <bpja@rpath.com>
Message-Id: <200903050610.n256A9vM008617@scc.eng.rpath.com>
Date: Thu, 05 Mar 2009 01:10:08 -0500
To: xobj-commits@lists.rpath.com
Subject: xobj: Allow XObjString.value to be bindable. Support typed
	elements with TEXT nodes
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 05 Mar 2009 06:10:11 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjString.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Allow XObjString.value to be bindable. Support typed elements with TEXT nodes

diff -r 37d2e9009b1d -r 7c9e96b1ba58 as3/xobjas3/src/com/rpath/xobj/XObjString.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjString.as	Wed Mar 04 09:11:22 2009 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjString.as	Thu Mar 05 01:10:02 2009 -0500
@@ -43,6 +43,7 @@
 public dynamic class XObjString
 {
 
+    [Bindable]
     public var value:String;
 
     public var _xobj:XObjMetadata;
diff -r 37d2e9009b1d -r 7c9e96b1ba58 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Wed Mar 04 09:11:22 2009 -0500
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Thu Mar 05 01:10:02 2009 -0500
@@ -321,15 +321,26 @@
         if ((children.length == 1) && (children[0].nodeType == XMLNodeType.TEXT_NODE))
         {
             nullObject = false;
-            // If exactly one text node subtype, we must want a simple
-            // value.
-            
-            //TODO: if the propType is provided then we SHOULD NOT assume simpleType. Further, if we 
-            //end up adding attrs to it (see below), we want propType not ComplexString
-            
-            isSimpleType = true;
-            
-            result = XObjXMLDecoder.simpleType(children[0].nodeValue);
+
+            var temp:* = XObjXMLDecoder.simpleType(children[0].nodeValue);
+            if (!isSpecifiedType || 
+                (result is String) || (resultTypeName == "com.rpath.xobj.XObjString") || (result is int) || (result is Number))
+            {
+                isSimpleType = true;
+                result = temp;
+            }
+            else
+            {
+                try
+                {
+                    result.value = temp;
+                }
+                catch (e:Error)
+                {
+                    // give up
+                }
+            }
+                
         }
         else 
         {

From misa@rpath.com Tue Mar 10 12:00:25 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2AG0PM6006961
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 16:00:25 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2AG0Ooo020461
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 12:00:25 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2AG0O8D027049
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 12:00:24 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2AG0HP5027826
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 12:00:23 -0400
Received: (from misa@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2ADNexc021097
	for xobj-commits@lists.rpath.com; Tue, 10 Mar 2009 09:23:40 -0400
From: Mihai Ibanescu <misa@rpath.com>
Message-Id: <200903101323.n2ADNexc021097@scc.eng.rpath.com>
Date: Tue, 10 Mar 2009 09:23:39 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: XML comparison function
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 10 Mar 2009 16:00:26 -0000

tag:         tip
user:        Mihai Ibanescu <https://issues.rpath.com/>
files:       py/test/xobjtest.py

XML comparison function

diff -r 7c9e96b1ba58 -r 8a17b91f499f py/test/xobjtest.py
--- a/py/test/xobjtest.py	Thu Mar 05 01:10:02 2009 -0500
+++ b/py/test/xobjtest.py	Tue Mar 10 09:22:17 2009 -0400
@@ -22,14 +22,42 @@
 from StringIO import StringIO
 
 def _xml(fn, s, asFile = False):
-    f = open("../../test/%s.xml" % fn, "w")
-    f.write(s)
     if asFile:
         return StringIO(s)
 
     return s
 
-class XobjTest(testhelp.TestCase):
+class TestCase(testhelp.TestCase):
+    @classmethod
+    def assertXmlEqual(cls, s1, s2):
+        d1 = etree.fromstring(s1)
+        d2 = etree.fromstring(s2)
+        return cls._compareTrees(d1, d2)
+
+    @classmethod
+    def _compareTrees(cls, t1, t2):
+        # Two DOM trees are equal if:
+        # 1. the tags are identical
+        if not (t1.tag == t2.tag):
+            return False
+        # 2. Same text
+        if not (t1.text == t2.text):
+            return False
+        # 3. The attributes are identical (order is not important)
+        if not (dict(t1.items()) == dict(t2.items())):
+            return False
+        # 3. Same number of children (so we can apply zip() below
+        ch1 = t1.getchildren()
+        ch2 = t2.getchildren()
+        if len(ch1) != len(ch2):
+            return False
+        # If all children are equal (recursively)
+        for child1, child2 in zip(ch1, ch2):
+            if not cls._compareTrees(child1, child2):
+                return False
+        return True
+
+class XobjTest(TestCase):
 
     def testSimpleParse(self):
         xml = _xml('simple', '<top attr1="anattr" attr2="another">\n'
@@ -261,7 +289,7 @@
         o = xobj.parsef(xml)
         assert(o.top.other_tag.other_val == '1')
         assert(o.top.other2_tag.val == '2')
-        assert(o.toxml(xml_declaration = False) == xmlString)
+        self.assertXmlEqual(o.toxml(xml_declaration = False), xmlString)
 
         class Top(xobj.Document):
             nameSpaceMap = { 'other3' : 'http://other/other2' }
@@ -271,7 +299,7 @@
         assert(o.top.other3_tag.val == '2')
         newXmlString = xmlString.replace("other2:", "other3:")
         newXmlString = newXmlString.replace(":other2", ":other3")
-        assert(o.toxml(xml_declaration = False) == newXmlString)
+        self.assertXmlEqual(o.toxml(xml_declaration = False), newXmlString)
 
     def testSchemaValidation(self):
         s = (

From misa@rpath.com Tue Mar 10 14:14:40 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2AIEeUH007389
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 18:14:40 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2AIEdV6027303
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 14:14:39 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2AIEdDR001812
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 14:14:39 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2AIEdjO032608
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 14:14:39 -0400
Received: (from misa@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2AIEduH032603
	for xobj-commits@lists.rpath.com; Tue, 10 Mar 2009 14:14:39 -0400
From: Mihai Ibanescu <misa@rpath.com>
Message-Id: <200903101814.n2AIEduH032603@scc.eng.rpath.com>
Date: Tue, 10 Mar 2009 14:14:39 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Fixed the writing of XML into a shared directory
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 10 Mar 2009 18:14:40 -0000

tag:         tip
user:        Mihai Ibanescu <https://issues.rpath.com/>
files:       py/test/xobjtest.py test/id-in-ns1.xml test/intelement.xml

Fixed the writing of XML into a shared directory

diff -r 8a17b91f499f -r f81c1c4a13e1 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Tue Mar 10 09:22:17 2009 -0400
+++ b/py/test/xobjtest.py	Tue Mar 10 14:14:26 2009 -0400
@@ -11,6 +11,7 @@
 # or fitness for a particular purpose. See the MIT License for full details.
 #
 
+import os
 import types
 
 import testsuite
@@ -22,6 +23,13 @@
 from StringIO import StringIO
 
 def _xml(fn, s, asFile = False):
+    # We write out the XML files into a directory that is shared with the
+    # actionscript test suite. Make sure you hg add the file when you create a
+    # new one.
+    f = open(os.path.join(os.path.dirname(__file__),
+                          "../../test/%s.xml" % fn), "w")
+    f.write(s)
+
     if asFile:
         return StringIO(s)
 
@@ -30,6 +38,10 @@
 class TestCase(testhelp.TestCase):
     @classmethod
     def assertXmlEqual(cls, s1, s2):
+        """
+        A more reliable way to compare two XML documents. The order of
+        attributes is undefined, and that should not break the equality.
+        """
         d1 = etree.fromstring(s1)
         d2 = etree.fromstring(s2)
         return cls._compareTrees(d1, d2)
@@ -46,12 +58,12 @@
         # 3. The attributes are identical (order is not important)
         if not (dict(t1.items()) == dict(t2.items())):
             return False
-        # 3. Same number of children (so we can apply zip() below
+        # 3. Same number of children (so we can apply zip() below)
         ch1 = t1.getchildren()
         ch2 = t2.getchildren()
         if len(ch1) != len(ch2):
             return False
-        # If all children are equal (recursively)
+        # 4. Children on corresponding positions are equal (recursively)
         for child1, child2 in zip(ch1, ch2):
             if not cls._compareTrees(child1, child2):
                 return False
diff -r 8a17b91f499f -r f81c1c4a13e1 test/id-in-ns1.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/id-in-ns1.xml	Tue Mar 10 14:14:26 2009 -0400
@@ -0,0 +1,4 @@
+<ns:top xmlns:ns="http://somens.xsd">
+  <ns:item ns:id="theid" ns:val="value"/>
+  <ns:ref ns:other="theid"/>
+</ns:top>
diff -r 8a17b91f499f -r f81c1c4a13e1 test/intelement.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/intelement.xml	Tue Mar 10 14:14:26 2009 -0400
@@ -0,0 +1,1 @@
+<top><anint>5</anint></top>
\ No newline at end of file

From mtharp@rpath.com Tue Mar 10 15:44:10 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2AJiAvs007651
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 19:44:10 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2AJiAnh031277
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 15:44:10 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2AJiAWA006225
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 15:44:10 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2AJiApw002451
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 15:44:10 -0400
Received: (from mtharp@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2AJiAIP002446
	for xobj-commits@lists.rpath.com; Tue, 10 Mar 2009 19:44:10 GMT
From: Michael Tharp <mtharp@rpath.com>
Message-Id: <200903101944.n2AJiAIP002446@scc.eng.rpath.com>
Date: Tue, 10 Mar 2009 19:44:09 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Give a clearer error if there are no root elements
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 10 Mar 2009 19:44:11 -0000

tag:         tip
user:        Michael Tharp <mtharp@rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

Give a clearer error if there are no root elements

diff -r f81c1c4a13e1 -r 648306295ab9 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Tue Mar 10 14:14:26 2009 -0400
+++ b/py/test/xobjtest.py	Tue Mar 10 19:44:07 2009 +0000
@@ -761,6 +761,17 @@
         self.failUnlessEqual(top.foo, doc.top.foo)
         self.failUnlessEqual(top.bar, doc.top.bar)
 
+    def testMissingRootElement(self):
+        """
+        Test that an error is raised if toxml() is called on a document
+        with no root element.
+        """
+        class Broken(xobj.Document):
+            top = str
+        xml = Broken()
+        error = self.assertRaises(RuntimeError, xml.toxml)
+        self.assertEquals(error.args, ('Document has no root element.',))
+
 
 if __name__ == "__main__":
     testsuite.main()
diff -r f81c1c4a13e1 -r 648306295ab9 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Tue Mar 10 14:14:26 2009 -0400
+++ b/py/xobj/xobj.py	Tue Mar 10 19:44:07 2009 +0000
@@ -302,9 +302,11 @@
         self.__schema = schema
 
     def toxml(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
-        for key, val in self.__dict__.iteritems():
-            if key[0] == '_': continue
-            break
+        items = sorted((key, value) for (key, value) in self.__dict__.items()
+                if not key.startswith('_'))
+        if not items:
+            raise RuntimeError("Document has no root element.")
+        rootName, rootValue = items[0]
 
         if self.__explicitNamespaces:
             map = self.__xmlNsMap.copy()
@@ -312,7 +314,8 @@
         else:
             map = self.__xmlNsMap
 
-        gen = ElementGenerator(val, key, nsmap = map, schema = self.__schema)
+        gen = ElementGenerator(rootValue, rootName,
+                nsmap=map, schema=self.__schema)
         return gen.tostring(prettyPrint = prettyPrint,
                             xml_declaration = xml_declaration)
 

From dbc@rpath.com Tue Mar 10 16:44:31 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2AKiV0g007822
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 20:44:31 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2AKiVGU001809
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 16:44:31 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2AKiUHE011679
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 16:44:31 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2AKiU96004119
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 16:44:30 -0400
Received: (from dbc@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2AKiUlO004097
	for xobj-commits@lists.rpath.com; Tue, 10 Mar 2009 16:44:30 -0400
From: David Christian <dbc@rpath.com>
Message-Id: <200903102044.n2AKiUlO004097@scc.eng.rpath.com>
Date: Tue, 10 Mar 2009 16:44:30 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Allow for ordered attribute dictionaries.
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 10 Mar 2009 20:44:31 -0000

user:        David Christian <http://issues.rpath.com>
files:       py/xobj/xobj.py

Allow for ordered attribute dictionaries.

diff -r 37d2e9009b1d -r 29ba7f2d5ddc py/xobj/xobj.py
--- a/py/xobj/xobj.py	Wed Mar 04 09:11:22 2009 -0500
+++ b/py/xobj/xobj.py	Tue Mar 10 15:59:27 2009 -0400
@@ -126,7 +126,7 @@
             self.elements = []
 
         if attributes:
-            if type(attributes) == dict:
+            if isinstance(attributes, dict):
                 self.attributes = attributes.copy()
             else:
                 self.attributes = dict( (x, None) for x in attributes )
@@ -242,6 +242,16 @@
             for name in (set(elements) - set(xobj._xobj.elements)):
                 for val in elements[name]:
                     orderedElements.append((name, val))
+            attrSet = xobj._xobj.attributes
+            if type(attrSet) != dict:
+                # allow for ordered dictionaries
+                orderedAttrs = xobj._xobj.attributes.__class__()
+                for key in attrSet.keys():
+                    if key in attrs:
+                        orderedAttrs[key] = attrs.pop(key)
+                for key in attrs.keys():
+                    orderedAttrs[key] = attrs[key]
+                attrs = orderedAttrs
         else:
             orderedElements = sorted(elements.iteritems())
 

From dbc@rpath.com Tue Mar 10 16:44:34 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2AKiXoi007827
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 20:44:33 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2AKiXiJ001813
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 16:44:33 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2AKiXro011684
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 16:44:33 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2AKiW7B004143
	for <xobj-commits@lists.rpath.com>; Tue, 10 Mar 2009 16:44:32 -0400
Received: (from dbc@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2AKiVit004137
	for xobj-commits@lists.rpath.com; Tue, 10 Mar 2009 16:44:31 -0400
From: David Christian <dbc@rpath.com>
Message-Id: <200903102044.n2AKiVit004137@scc.eng.rpath.com>
Date: Tue, 10 Mar 2009 16:44:31 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: branch merge
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 10 Mar 2009 20:44:34 -0000

tag:         tip
user:        David Christian <http://issues.rpath.com>
files:       py/xobj/xobj.py

branch merge

diff -r 29ba7f2d5ddc -r 41e2e012cffe py/xobj/xobj.py
--- a/py/xobj/xobj.py	Tue Mar 10 15:59:27 2009 -0400
+++ b/py/xobj/xobj.py	Tue Mar 10 16:44:25 2009 -0400
@@ -312,9 +312,11 @@
         self.__schema = schema
 
     def toxml(self, nsmap = {}, prettyPrint = True, xml_declaration = True):
-        for key, val in self.__dict__.iteritems():
-            if key[0] == '_': continue
-            break
+        items = sorted((key, value) for (key, value) in self.__dict__.items()
+                if not key.startswith('_'))
+        if not items:
+            raise RuntimeError("Document has no root element.")
+        rootName, rootValue = items[0]
 
         if self.__explicitNamespaces:
             map = self.__xmlNsMap.copy()
@@ -322,7 +324,8 @@
         else:
             map = self.__xmlNsMap
 
-        gen = ElementGenerator(val, key, nsmap = map, schema = self.__schema)
+        gen = ElementGenerator(rootValue, rootName,
+                nsmap=map, schema=self.__schema)
         return gen.tostring(prettyPrint = prettyPrint,
                             xml_declaration = xml_declaration)
 

From bmurphy@rpath.com Wed Mar 18 13:23:59 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2IHNxfq010971
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 17:23:59 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2IHNwFU008834
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 13:23:58 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2IHNwZh018846
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 13:23:58 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2IHNv5a003594
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 13:23:57 -0400
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2IHNvI1003589
	for xobj-commits@lists.rpath.com; Wed, 18 Mar 2009 13:23:57 -0400
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200903181723.n2IHNvI1003589@scc.eng.rpath.com>
Date: Wed, 18 Mar 2009 13:23:57 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Introduced new xobjTransient metadat tag and tests.  This
	tag will tell xobj
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 18 Mar 2009 17:23:59 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       as3/xobjas3-test/src/TestSuite1.as as3/xobjas3-test/src/tests/TestTransients.as as3/xobjas3-test/src/tests/models/TestableObject.as as3/xobjas3/.actionScriptProperties as3/xobjas3/.flexLibProperties as3/xobjas3/build.xml as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as

Introduced new xobjTransient metadat tag and tests.  This tag will tell xobj
not to encode the property (like Transient), but deep copying will still copy
it (unlike Transient).

diff -r 41e2e012cffe -r 1b8701fc2a9f as3/xobjas3-test/src/TestSuite1.as
--- a/as3/xobjas3-test/src/TestSuite1.as	Tue Mar 10 16:44:25 2009 -0400
+++ b/as3/xobjas3-test/src/TestSuite1.as	Wed Mar 18 13:23:49 2009 -0400
@@ -16,13 +16,14 @@
     
     import net.digitalprimates.fluint.tests.TestSuite;
     
-    import tests.TestBasics;
+    import tests.*;
 
     public class TestSuite1 extends TestSuite
     {
         public function TestSuite1()
         {
-            addTestCase( new TestBasics() );
+            addTestCase(new TestBasics());
+            addTestCase(new TestTransients());
         }
 
     }
diff -r 41e2e012cffe -r 1b8701fc2a9f as3/xobjas3-test/src/tests/TestTransients.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/TestTransients.as	Wed Mar 18 13:23:49 2009 -0400
@@ -0,0 +1,64 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests
+{
+    import com.rpath.xobj.*;
+    
+    import flash.xml.*;
+    
+    import mx.utils.ObjectUtil;
+    
+    import tests.models.*;
+    
+    
+    public class TestTransients extends TestBase
+    {
+        /** 
+         * Ensure transient data is never encoded
+         */
+        public function testTransient():void
+        {
+            var obj:TestableObject = new TestableObject();
+            obj.someVal = "someval";
+            obj.transientVar = "transient";
+            obj.xobjTransientVar = "xobjtransient";
+            var typeMap:* = {obj: TestableObject};
+            
+            var typedEncoder:XObjXMLEncoder = new XObjXMLEncoder(typeMap);
+            var xmlOutput:XMLDocument = typedEncoder.encodeObject(obj);
+    
+            // neither the Transient nor the xobjTransient vars should be there
+            var expectedString:String = 
+                    '<obj>\n'+
+                    '  <someVal>someval</someVal>\n'+
+                    '</obj>\n';
+            
+            assertTrue(compareXMLtoString(xmlOutput, expectedString));
+            
+            // now decode it and validate
+            var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder(typeMap);
+            var xmlInput:XMLDocument = xmlOutput;
+            var o:* = typedDecoder.decodeXML(xmlInput);
+            assertTrue(o.obj is TestableObject);
+            assertTrue(o.obj.someVal =="someval");
+            assertTrue(o.obj.transientVar == null);
+            assertTrue(o.obj.xobjTransientVar == null);
+            
+            // reencode and check round-trip
+            xmlOutput = typedEncoder.encodeObject(o);
+            assertTrue("encode matches input", compareXML(xmlOutput, xmlInput));
+        }
+    }
+}
+
diff -r 41e2e012cffe -r 1b8701fc2a9f as3/xobjas3-test/src/tests/models/TestableObject.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/models/TestableObject.as	Wed Mar 18 13:23:49 2009 -0400
@@ -0,0 +1,29 @@
+/*
+#
+# Copyright (c) 2008 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests.models
+{
+    /**
+     * A random object for use in validating encoding of objects
+     */ 
+    public class TestableObject
+    {
+        public var someVal:String;
+        
+        [Transient]
+        public var transientVar:String;
+        
+        [xobjTransient]
+        public var xobjTransientVar:String;
+    }
+}
\ No newline at end of file
diff -r 41e2e012cffe -r 1b8701fc2a9f as3/xobjas3/.actionScriptProperties
--- a/as3/xobjas3/.actionScriptProperties	Tue Mar 10 16:44:25 2009 -0400
+++ b/as3/xobjas3/.actionScriptProperties	Wed Mar 18 13:23:49 2009 -0400
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <actionScriptProperties mainApplicationPath="xobjas3.as" version="3">
-<compiler additionalCompilerArguments="" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
-<compilerSourcePath/>
-<libraryPath defaultLinkType="1">
-<libraryPathEntry kind="4" path=""/>
-</libraryPath>
-<sourceAttachmentPath/>
-</compiler>
-<applications>
-<application path="xobjas3.as"/>
-</applications>
-<modules/>
-<buildCSSFiles/>
+  <compiler additionalCompilerArguments="-keep-as3-metadata xobjTransient" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="1">
+      <libraryPathEntry kind="4" path=""/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="xobjas3.as"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
 </actionScriptProperties>
diff -r 41e2e012cffe -r 1b8701fc2a9f as3/xobjas3/.flexLibProperties
--- a/as3/xobjas3/.flexLibProperties	Tue Mar 10 16:44:25 2009 -0400
+++ b/as3/xobjas3/.flexLibProperties	Wed Mar 18 13:23:49 2009 -0400
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <flexLibProperties version="1">
-<includeClasses>
-<classEntry path="com.rpath.xobj.XObjUtils"/>
-<classEntry path="com.rpath.xobj.XObjXMLEncoder"/>
-<classEntry path="com.rpath.xobj.XObjString"/>
-<classEntry path="com.rpath.xobj.SchemaAwareXMLDecoder"/>
-<classEntry path="com.rpath.xobj.XObjQName"/>
-<classEntry path="com.rpath.xobj.XObjMetadata"/>
-<classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
-<classEntry path="com.rpath.xobj.XObjXMLDecoder"/>
-</includeClasses>
-<includeResources/>
-<namespaceManifests/>
+  <includeClasses>
+    <classEntry path="com.rpath.xobj.XObjUtils"/>
+    <classEntry path="com.rpath.xobj.XObjXMLEncoder"/>
+    <classEntry path="com.rpath.xobj.XObjString"/>
+    <classEntry path="com.rpath.xobj.SchemaAwareXMLDecoder"/>
+    <classEntry path="com.rpath.xobj.XObjQName"/>
+    <classEntry path="com.rpath.xobj.XObjMetadata"/>
+    <classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
+    <classEntry path="com.rpath.xobj.XObjXMLDecoder"/>
+  </includeClasses>
+  <includeResources/>
+  <namespaceManifests/>
 </flexLibProperties>
diff -r 41e2e012cffe -r 1b8701fc2a9f as3/xobjas3/build.xml
--- a/as3/xobjas3/build.xml	Tue Mar 10 16:44:25 2009 -0400
+++ b/as3/xobjas3/build.xml	Wed Mar 18 13:23:49 2009 -0400
@@ -73,6 +73,9 @@
     			<!-- Register the namespace -->
                 <namespace uri="@{namespace}" manifest="@{manifest}" />
                 <include-namespaces uri="@{namespace}"/>
+    			
+    			<!-- Include the xobjTransient metadata tag -->
+    			<keep-as3-metadata name="xobjTransient"/>
             </compc>
 			
             <echo>Build completed</echo>
diff -r 41e2e012cffe -r 1b8701fc2a9f as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Tue Mar 10 16:44:25 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Wed Mar 18 13:23:49 2009 -0400
@@ -13,159 +13,513 @@
 
 package com.rpath.xobj
 {
+    import mx.collections.ArrayCollection;
+    import mx.utils.DescribeTypeCache;
+    import mx.utils.ObjectProxy;
+
+    import flash.utils.getQualifiedClassName;
     import flash.utils.getDefinitionByName;
     import flash.xml.XMLNode;
     
-    import mx.collections.ArrayCollection;
-    import mx.utils.DescribeTypeCache;
-
+    import mx.utils.object_proxy;
+    use namespace object_proxy;
     
     public class XObjUtils
     {
 
 
-    public static const DEFAULT_NAMESPACE_PREFIX:String = "_default_";
-
-    /**
-     * Returns the local name of an XMLNode.
-     *
-     * @return The local name of an XMLNode.
-     */
-    public static function getLocalName(xmlNode:XMLNode):String
-    {
-        return getNCName(xmlNode.nodeName);
-    }
-
-    public static function getNCName(name:String):String
-    {
-        var myPrefixIndex:int = name.indexOf(":");
-        if (myPrefixIndex != -1)
+        public static const DEFAULT_NAMESPACE_PREFIX:String = "_default_";
+        
+        /**
+         * @private
+         */ 
+        private static var CLASS_INFO_CACHE:Object = {};
+    
+        /**
+         * Returns the local name of an XMLNode.
+         *
+         * @return The local name of an XMLNode.
+         */
+        public static function getLocalName(xmlNode:XMLNode):String
         {
-            name = name.substring(myPrefixIndex+1);
+            return getNCName(xmlNode.nodeName);
         }
-        return name;
-    }
-
-
-    public static function encodeElementTag(qname:XObjQName, node:XMLNode):String
-    {
-        var elementTag:String = XObjUtils.getNCName(qname.localName);
+    
+        public static function getNCName(name:String):String
+        {
+            var myPrefixIndex:int = name.indexOf(":");
+            if (myPrefixIndex != -1)
+            {
+                name = name.substring(myPrefixIndex+1);
+            }
+            return name;
+        }
+    
+    
+        public static function encodeElementTag(qname:XObjQName, node:XMLNode):String
+        {
+            var elementTag:String = XObjUtils.getNCName(qname.localName);
+            
+            var prefix:String = node.getPrefixForNamespace(qname.uri);
+            
+            if (prefix)
+                elementTag =  prefix + ":" + elementTag;
+            
+            return elementTag;
+        }
+            
+            
+            
+        /**
+         * Return a Class instance based on a string class name
+         * @private
+          */
+        public static function getClassByName(className:String):Class
+        {
+            var classReference:Class = null;
+            
+            try
+            {
+                 classReference = getDefinitionByName(className) as Class;
+            } 
+            catch (e:ReferenceError)
+            {
+                trace("Request for unknown class "+className);
+            }
+    
+            return classReference;
+         }    
+         
+        private static var typePropertyCache:Object = {};
+    
+        public static function isTypeArray(type:Class):Boolean
+        {
+            if (type == null)
+                return false;
+            
+            var foo:* = new type();
+            return (foo is Array);
+        }
+    
+        public static function isTypeArrayCollection(type:Class):Boolean
+        {
+            if (type == null)
+                return false;
+    
+            var foo:* = new type();
+            return (type is ArrayCollection);
+        }
         
-        var prefix:String = node.getPrefixForNamespace(qname.uri);
-        
-        if (prefix)
-            elementTag =  prefix + ":" + elementTag;
-        
-        return elementTag;
-    }
-        
-        
-        
-    /**
-     * Return a Class instance based on a string class name
-     * @private
-      */
-    public static function getClassByName(className:String):Class
-    {
-        var classReference:Class = null;
-        
-        try
+        public static function typeInfoForProperty(className:String, propName:String):Object
         {
-             classReference = getDefinitionByName(className) as Class;
-        } 
-        catch (e:ReferenceError)
-        {
-            trace("Request for unknown class "+className);
+            var isArray:Boolean = false;
+            var result:Object = {typeName: null, isArray: false, isArrayCollection: false};
+            
+            if (className == "Object" || className == "mx.utils::ObjectProxy")
+                return result;
+            
+            var propertyCacheKey:String = className + "." + propName;
+            var arrayElementType:String;
+            
+            result = typePropertyCache[propertyCacheKey];
+                
+            if (result == null)
+            {
+                result = {typeName: null, isArray: false, isArrayCollection: false};
+                
+                // go look it up (expensive)
+                var typeDesc:* = DescribeTypeCache.describeType(className);
+                var typeInfo:XML = typeDesc.typeDescription;
+                
+                result.typeName = typeInfo..accessor.(@name == propName).@type.toString().replace( /::/, "." );
+                if (result.typeName == null || result.typeName == "")
+                {    
+                    result.typeName = typeInfo..variable.(@name == propName).@type.toString().replace( /::/, "." );
+                    arrayElementType = typeInfo..variable.(@name == propName).metadata.(@name == 'ArrayElementType').arg.@value.toString().replace( /::/, "." );
+                }
+                else
+                    arrayElementType = typeInfo..accessor.(@name == propName).metadata.(@name == 'ArrayElementType').arg.@value.toString().replace( /::/, "." );
+                
+                if (result.typeName == "Array")
+                {
+                    result.isArray = true;
+                    result.typeName = null; // assume generic object unless told otherwise
+                }
+                else if (result.typeName == "ArrayCollection")
+                {
+                    result.isArrayCollection = true;
+                    result.typeName = null; // assume generic object unless told otherwise
+                }
+                
+                if (arrayElementType != "")
+                {
+                    // use type specified
+                    result.typeName = arrayElementType;
+                }
+                
+                if (result.typeName == "Object"
+                    || result.typeName == "mx.utils::ObjectProxy"
+                    || result.typeName == "Undefined"
+                    || result.typeName == "*"
+                    || result.typeName == "")
+                {
+                    result.typeName = null;
+                }
+                     
+                // cache the result for next time
+                typePropertyCache[propertyCacheKey] = result;
+            }
+            
+           
+            return result;
         }
-
-        return classReference;
-     }    
-     
-    private static var typePropertyCache:Object = {};
-
-    public static function isTypeArray(type:Class):Boolean
-    {
-        if (type == null)
-            return false;
-        
-        var foo:* = new type();
-        return (foo is Array);
-    }
-
-    public static function isTypeArrayCollection(type:Class):Boolean
-    {
-        if (type == null)
-            return false;
-
-        var foo:* = new type();
-        return (type is ArrayCollection);
-    }
     
-    public static function typeInfoForProperty(className:String, propName:String):Object
-    {
-        var isArray:Boolean = false;
-        var result:Object = {typeName: null, isArray: false, isArrayCollection: false};
-        
-        if (className == "Object" || className == "mx.utils::ObjectProxy")
-            return result;
-        
-        var propertyCacheKey:String = className + "." + propName;
-        var arrayElementType:String;
-        
-        result = typePropertyCache[propertyCacheKey];
-            
-        if (result == null)
-        {
-            result = {typeName: null, isArray: false, isArrayCollection: false};
-            
-            // go look it up (expensive)
-            var typeDesc:* = DescribeTypeCache.describeType(className);
-            var typeInfo:XML = typeDesc.typeDescription;
-            
-            result.typeName = typeInfo..accessor.(@name == propName).@type.toString().replace( /::/, "." );
-            if (result.typeName == null || result.typeName == "")
-            {    
-                result.typeName = typeInfo..variable.(@name == propName).@type.toString().replace( /::/, "." );
-                arrayElementType = typeInfo..variable.(@name == propName).metadata.(@name == 'ArrayElementType').arg.@value.toString().replace( /::/, "." );
+        /**
+         * Use our own version of getClassInfo to support various metadata
+         * tags we use.  See ObjectUtil.getClassInfo for more info about
+         * the baisc functionality of this method.
+         */  
+        public static function getClassInfo(obj:Object,
+                                            excludes:Array = null,
+                                            options:Object = null):Object
+        {   
+            var n:int;
+            var i:int;
+    
+            if (obj is ObjectProxy)
+                obj = ObjectProxy(obj).object_proxy::object;
+    
+            if (options == null)
+                options = { includeReadOnly: true, uris: null, includeTransient: true };
+    
+            var result:Object;
+            var propertyNames:Array = [];
+            var cacheKey:String;
+    
+            var className:String;
+            var classAlias:String;
+            var properties:XMLList;
+            var prop:XML;
+            var dynamic:Boolean = false;
+            var metadataInfo:Object;
+    
+            if (typeof(obj) == "xml")
+            {
+                className = "XML";
+                properties = obj.text();
+                if (properties.length())
+                    propertyNames.push("*");
+                properties = obj.attributes();
             }
             else
-                arrayElementType = typeInfo..accessor.(@name == propName).metadata.(@name == 'ArrayElementType').arg.@value.toString().replace( /::/, "." );
+            {
+                var classInfo:XML = DescribeTypeCache.describeType(obj).typeDescription;
+                className = classInfo.@name.toString();
+                classAlias = classInfo.@alias.toString();
+                dynamic = (classInfo.@isDynamic.toString() == "true");
+    
+                if (options.includeReadOnly)
+                    properties = classInfo..accessor.(@access != "writeonly") + classInfo..variable;
+                else
+                    properties = classInfo..accessor.(@access == "readwrite") + classInfo..variable;
+    
+                var numericIndex:Boolean = false;
+            }
+    
+            // If type is not dynamic, check our cache for class info...
+            if (!dynamic)
+            {
+                cacheKey = getCacheKey(obj, excludes, options);
+                result = CLASS_INFO_CACHE[cacheKey];
+                if (result != null)
+                    return result;
+            }
+    
+            result = {};
+            result["name"] = className;
+            result["alias"] = classAlias;
+            result["properties"] = propertyNames;
+            result["dynamic"] = dynamic;
+            result["metadata"] = metadataInfo = recordMetadata(properties);
             
-            if (result.typeName == "Array")
+            var excludeObject:Object = {};
+            if (excludes)
             {
-                result.isArray = true;
-                result.typeName = null; // assume generic object unless told otherwise
+                n = excludes.length;
+                for (i = 0; i < n; i++)
+                {
+                    excludeObject[excludes[i]] = 1;
+                }
             }
-            else if (result.typeName == "ArrayCollection")
+    
+            //TODO this seems slightly fragile, why not use the 'is' operator?
+            var isArray:Boolean = (className == "Array");
+            var isDict:Boolean  = (className == "flash.utils::Dictionary");
+            
+            if (isDict)
             {
-                result.isArrayCollection = true;
-                result.typeName = null; // assume generic object unless told otherwise
+                // dictionaries can have multiple keys of the same type,
+                // (they can index by reference rather than QName, String, or number),
+                // which cannot be looked up by QName, so use references to the actual key
+                for (var key:* in obj)
+                {
+                    propertyNames.push(key);
+                }
+            }
+            else if (dynamic)
+            {
+                for (var p:String in obj)
+                {
+                    if (excludeObject[p] != 1)
+                    {
+                        if (isArray)
+                        {
+                             var pi:Number = parseInt(p);
+                             if (isNaN(pi))
+                                propertyNames.push(new QName("", p));
+                             else
+                                propertyNames.push(pi);
+                        }
+                        else
+                        {
+                            propertyNames.push(new QName("", p));
+                        }
+                    }
+                }
+                numericIndex = isArray && !isNaN(Number(p));
+            }
+    
+            if (isArray || isDict || className == "Object")
+            {
+                // Do nothing since we've already got the dynamic members
+            }
+            else if (className == "XML")
+            {
+                n = properties.length();
+                for (i = 0; i < n; i++)
+                {
+                    p = properties[i].name();
+                    if (excludeObject[p] != 1)
+                        propertyNames.push(new QName("", "@" + p));
+                }
+            }
+            else
+            {
+                n = properties.length();
+                var uris:Array = options.uris;
+                var uri:String;
+                var qName:QName;
+                for (i = 0; i < n; i++)
+                {
+                    prop = properties[i];
+                    p = prop.@name.toString();
+                    uri = prop.@uri.toString();
+                    
+                    if (excludeObject[p] == 1)
+                        continue;
+                        
+                    if (!options.includeTransient && internalHasMetadata(metadataInfo, p, "Transient"))
+                        continue;
+                        
+                    if (internalHasMetadata(metadataInfo, p, "xobjTransient"))
+                        continue;
+                    
+                    if (uris != null)
+                    {
+                        if (uris.length == 1 && uris[0] == "*")
+                        {   
+                            qName = new QName(uri, p);
+                            try
+                            {
+                                obj[qName]; // access the property to ensure it is supported
+                                propertyNames.push();
+                            }
+                            catch(e:Error)
+                            {
+                                // don't keep property name 
+                            }
+                        }
+                        else
+                        {
+                            for (var j:int = 0; j < uris.length; j++)
+                            {
+                                uri = uris[j];
+                                if (prop.@uri.toString() == uri)
+                                {
+                                    qName = new QName(uri, p);
+                                    try
+                                    {
+                                        obj[qName];
+                                        propertyNames.push(qName);
+                                    }
+                                    catch(e:Error)
+                                    {
+                                        // don't keep property name 
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    else if (uri.length == 0)
+                    {
+                        qName = new QName(uri, p);
+                        try
+                        {
+                            obj[qName];
+                            propertyNames.push(qName);
+                        }
+                        catch(e:Error)
+                        {
+                            // don't keep property name 
+                        }
+                    }
+                }
+            }
+    
+            propertyNames.sort(Array.CASEINSENSITIVE |
+                               (numericIndex ? Array.NUMERIC : 0));
+    
+            // dictionary keys can be indexed by an object reference
+            // there's a possibility that two keys will have the same toString()
+            // so we don't want to remove dupes
+            if (!isDict)
+            {
+                // for Arrays, etc., on the other hand...
+                // remove any duplicates, i.e. any items that can't be distingushed by toString()
+                for (i = 0; i < propertyNames.length - 1; i++)
+                {
+                    // the list is sorted so any duplicates should be adjacent
+                    // two properties are only equal if both the uri and local name are identical
+                    if (propertyNames[i].toString() == propertyNames[i + 1].toString())
+                    {
+                        propertyNames.splice(i, 1);
+                        i--; // back up
+                    }
+                }
+            }
+    
+            // For normal, non-dynamic classes we cache the class info
+            if (!dynamic)
+            {
+                cacheKey = getCacheKey(obj, excludes, options);
+                CLASS_INFO_CACHE[cacheKey] = result;
+            }
+    
+            return result;
+        }
+        
+        /**
+         *  @private
+         */
+        private static function internalHasMetadata(metadataInfo:Object, propName:String, metadataName:String):Boolean
+        {
+            if (metadataInfo != null)
+            {
+                var metadata:Object = metadataInfo[propName];
+                if (metadata != null)
+                {
+                    if (metadata[metadataName] != null)
+                        return true;
+                }
+            }
+            return false;
+        }
+    
+        /**
+         *  @private
+         */
+        private static function recordMetadata(properties:XMLList):Object
+        {
+            var result:Object = null;
+    
+            try
+            {
+                for each (var prop:XML in properties)
+                {
+                    var propName:String = prop.attribute("name").toString();
+                    var metadataList:XMLList = prop.metadata;
+    
+                    if (metadataList.length() > 0)
+                    {
+                        if (result == null)
+                            result = {};
+    
+                        var metadata:Object = {};
+                        result[propName] = metadata;
+    
+                        for each (var md:XML in metadataList)
+                        {
+                            var mdName:String = md.attribute("name").toString();
+                            
+                            var argsList:XMLList = md.arg;
+                            var value:Object = {};
+    
+                            for each (var arg:XML in argsList)
+                            {
+                                var argKey:String = arg.attribute("key").toString();
+                                if (argKey != null)
+                                {
+                                    var argValue:String = arg.attribute("value").toString();
+                                    value[argKey] = argValue;
+                                }
+                            }
+    
+                            var existing:Object = metadata[mdName];
+                            if (existing != null)
+                            {
+                                var existingArray:Array;
+                                if (existing is Array)
+                                    existingArray = existing as Array;
+                                else
+                                    existingArray = [];
+                                existingArray.push(value);
+                                existing = existingArray;
+                            }
+                            else
+                            {
+                                existing = value;
+                            }
+                            metadata[mdName] = existing;
+                        }
+                    }
+                }
+            }
+            catch(e:Error)
+            {
             }
             
-            if (arrayElementType != "")
+            return result;
+        }
+    
+    
+        /**
+         *  @private
+         */
+        private static function getCacheKey(o:Object, excludes:Array = null, options:Object = null):String
+        {
+            var key:String = getQualifiedClassName(o);
+    
+            if (excludes != null)
             {
-                // use type specified
-                result.typeName = arrayElementType;
+                for (var i:uint = 0; i < excludes.length; i++)
+                {
+                    var excl:String = excludes[i] as String;
+                    if (excl != null)
+                        key += excl;
+                }
             }
-            
-            if (result.typeName == "Object"
-                || result.typeName == "mx.utils::ObjectProxy"
-                || result.typeName == "Undefined"
-                || result.typeName == "*"
-                || result.typeName == "")
+    
+            if (options != null)
             {
-                result.typeName = null;
+                for (var flag:String in options)
+                {
+                    key += flag;
+                    var value:String = options[flag] as String;
+                    if (value != null)
+                        key += value;
+                }
             }
-                 
-            // cache the result for next time
-            typePropertyCache[propertyCacheKey] = result;
+            return key;
         }
-        
-       
-        return result;
-    }
-    
-
-        
     }
 }
\ No newline at end of file
diff -r 41e2e012cffe -r 1b8701fc2a9f as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as	Tue Mar 10 16:44:25 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as	Wed Mar 18 13:23:49 2009 -0400
@@ -31,9 +31,7 @@
 
 
 import flash.utils.*;
-import flash.xml.XMLDocument;
-import flash.xml.XMLNode;
-
+import flash.xml.*;
 import mx.utils.*;
 
     
@@ -311,7 +309,7 @@
             myElement.nodeName = XObjUtils.encodeElementTag(qname, myElement);
             
             // TODO: this is expensive. Can we optimize?
-            var classInfo:Object = ObjectUtil.getClassInfo(obj, [XObjMetadata.METADATA_PROPERTY, "attributes", "prototype"], CLASS_INFO_OPTIONS);
+            var classInfo:Object = XObjUtils.getClassInfo(obj, [XObjMetadata.METADATA_PROPERTY, "attributes", "prototype"], CLASS_INFO_OPTIONS);
             var properties:Array = (classInfo.properties as Array);
             
             var propsDone:Object = {};

From bmurphy@rpath.com Wed Mar 18 14:23:56 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2IINuh9011170
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 18:23:56 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2IINtTn011172
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 14:23:56 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2IINt2C022060
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 14:23:55 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2IINsXk005315
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 14:23:55 -0400
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2IINsXO005305
	for xobj-commits@lists.rpath.com; Wed, 18 Mar 2009 14:23:54 -0400
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200903181823.n2IINsXO005305@scc.eng.rpath.com>
Date: Wed, 18 Mar 2009 14:23:54 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Fixed copyrights
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 18 Mar 2009 18:23:56 -0000

user:        Brad Murphy <https://issues.rpath.com>
files:       as3/xobjas3-test/src/tests/TestTransients.as as3/xobjas3-test/src/tests/models/TestableObject.as

Fixed copyrights

diff -r 1b8701fc2a9f -r 55a7f7ec201e as3/xobjas3-test/src/tests/TestTransients.as
--- a/as3/xobjas3-test/src/tests/TestTransients.as	Wed Mar 18 13:23:49 2009 -0400
+++ b/as3/xobjas3-test/src/tests/TestTransients.as	Wed Mar 18 14:22:04 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 1b8701fc2a9f -r 55a7f7ec201e as3/xobjas3-test/src/tests/models/TestableObject.as
--- a/as3/xobjas3-test/src/tests/models/TestableObject.as	Wed Mar 18 13:23:49 2009 -0400
+++ b/as3/xobjas3-test/src/tests/models/TestableObject.as	Wed Mar 18 14:22:04 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license

From bmurphy@rpath.com Wed Mar 18 15:18:58 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2IJIwKW011558
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 19:18:58 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2IJIwo8013299
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 15:18:58 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2IJIvgv024830
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 15:18:58 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2IJIvdU007227
	for <xobj-commits@lists.rpath.com>; Wed, 18 Mar 2009 15:18:57 -0400
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2IJIvVP007222
	for xobj-commits@lists.rpath.com; Wed, 18 Mar 2009 15:18:57 -0400
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200903181918.n2IJIvVP007222@scc.eng.rpath.com>
Date: Wed, 18 Mar 2009 15:18:57 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Use our own flex-config (xobj-flex-config.xml) to allow for the
	xobjTransient
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 18 Mar 2009 19:18:58 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       as3/xobjas3-test/build.xml as3/xobjas3/build.xml as3/xobjas3/xobj-flex-config.xml

Use our own flex-config (xobj-flex-config.xml) to allow for the xobjTransient
metadat tag.  Required b/c ant compc is busted.

diff -r 55a7f7ec201e -r 2614b0bf3898 as3/xobjas3-test/build.xml
--- a/as3/xobjas3-test/build.xml	Wed Mar 18 14:22:04 2009 -0400
+++ b/as3/xobjas3-test/build.xml	Wed Mar 18 15:18:48 2009 -0400
@@ -56,7 +56,7 @@
             incremental="true" debug="true">
             
             <!-- Get default compiler options. -->
-            <load-config filename="${flex.sdk.frameworks.dir}/${flex-config.name}"/>
+            <load-config filename="${xobj.dir}/xobj-flex-config.xml"/>
     
             <!-- List of path elements that form the roots of ActionScript
             class hierarchies. -->
@@ -90,7 +90,7 @@
             incremental="true" debug="true">
             
             <!-- Get default compiler options. -->
-            <load-config filename="${flex.sdk.frameworks.dir}/${flex-config.name}"/>
+        	<load-config filename="${xobj.dir}/xobj-flex-config.xml"/>
     
             <!-- List of path elements that form the roots of ActionScript
             class hierarchies. -->
diff -r 55a7f7ec201e -r 2614b0bf3898 as3/xobjas3/build.xml
--- a/as3/xobjas3/build.xml	Wed Mar 18 14:22:04 2009 -0400
+++ b/as3/xobjas3/build.xml	Wed Mar 18 15:18:48 2009 -0400
@@ -49,6 +49,14 @@
 			<echo>Building @{title} flex lib...</echo>
 			
     		<compc output="@{outputLib}">
+    			
+    			<!-- 
+    			    Load our own config since ant compc is busted and doesn't
+    			    allow saving metadata.  The xobjTransient metadata tag
+    			    will not work without this. 
+    			-->
+    			<load-config filename="xobj-flex-config.xml"/>
+    			
     			<source-path path-element="@{srcDir}"/>
     			
     			<!-- Include libraries we need to link to -->
diff -r 55a7f7ec201e -r 2614b0bf3898 as3/xobjas3/xobj-flex-config.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3/xobj-flex-config.xml	Wed Mar 18 15:18:48 2009 -0400
@@ -0,0 +1,363 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright (c) 2009 rPath, Inc.
+
+ This program is distributed under the terms of the MIT License as found 
+ in a file called LICENSE. If it is not present, the license
+ is always available at http://www.opensource.org/licenses/mit-license.php.
+
+ This program is distributed in the hope that it will be useful, but
+ without any waranty; without even the implied warranty of merchantability
+ or fitness for a particular purpose. See the MIT License for full details.
+ 
+ <murf>  Note that we use our own config to support the xobjTransient
+         metadata tag.  There is a bug in ant compc preventing it from 
+         being usable there.
+-->
+
+<flex-config>
+    <!-- Specifies the minimum player version that will run the compiled SWF. -->
+    <!-- 9.0.124 is the April 2008 security release -->
+    <target-player>9.0.124</target-player>
+
+   <compiler>
+
+      <!-- Turn on generation of accessible SWFs. -->
+      <accessible>false</accessible>
+
+      <!-- Specifies the locales for internationalization. -->
+      <locale>
+          <locale-element>en_US</locale-element>
+      </locale>
+
+      <!-- List of path elements that form the roots of ActionScript class hierarchies. -->
+      <!-- not set -->
+      <!--
+      <source-path>
+         <path-element>string</path-element>
+      </source-path>
+      -->
+
+     <!-- Allow the source-path to have path-elements which contain other path-elements -->
+     <allow-source-path-overlap>false</allow-source-path-overlap>
+
+      <!-- Run the AS3 compiler in a mode that detects legal but potentially incorrect -->
+      <!-- code.                                                                       -->
+      <show-actionscript-warnings>true</show-actionscript-warnings>
+
+      <!-- Turn on generation of debuggable SWFs. False by default for mxmlc, -->
+      <!-- but true by default for compc. -->
+      <!--
+      <debug>true</debug>
+      -->
+
+      <!-- List of SWC files or directories to compile against but to omit from -->
+      <!-- linking.                                                             -->
+      <external-library-path>
+          <path-element>/opt/flex-sdk-3/frameworks/libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>
+      </external-library-path>
+
+      <!-- Turn on writing of generated/*.as files to disk. These files are generated by -->
+      <!-- the compiler during mxml translation and are helpful with understanding and   -->
+      <!-- debugging Flex applications.                                                  -->
+      <keep-generated-actionscript>false</keep-generated-actionscript>
+
+      <!-- not set -->
+      <!--
+      <include-libraries>
+         <library>string</library>
+      </include-libraries>
+      -->
+
+      <!-- List of SWC files or directories that contain SWC files. -->
+      <library-path>
+         <path-element>/opt/flex-sdk-3/frameworks/libs</path-element>   
+		 <!-- keep the original location in the libpath for backwards-compatibility -->
+         <path-element>/opt/flex-sdk-3/frameworks/libs/player</path-element>
+         <path-element>/opt/flex-sdk-3/frameworks/libs/player/{targetPlayerMajorVersion}</path-element>    
+	     <path-element>/opt/flex-sdk-3/frameworks/locale/{locale}</path-element>
+      </library-path>
+
+      <namespaces>
+      <!-- Specify a URI to associate with a manifest of components for use as MXML -->
+      <!-- elements.                                                                -->
+         <namespace>
+            <uri>http://www.adobe.com/2006/mxml</uri>
+            <manifest>/opt/flex-sdk-3/frameworks/mxml-manifest.xml</manifest>
+         </namespace>
+      </namespaces>
+
+      <!-- Enable post-link SWF optimization. -->
+      <optimize>true</optimize>
+
+      <!-- Keep the following AS3 metadata in the bytecodes.                                             -->
+      <!-- Warning: For the data binding feature in the Flex framework to work properly,                 -->
+      <!--          the following metadata must be kept:                                                 -->
+      <!--          1. Bindable                                                                          -->
+      <!--          2. Managed                                                                           -->
+      <!--          3. ChangeEvent                                                                       -->
+      <!--          4. NonCommittingChangeEvent                                                          -->
+      <!--          5. Transient                                                                         -->
+      
+      <keep-as3-metadata>
+          <name>Bindable</name>
+          <name>Managed</name>
+          <name>ChangeEvent</name>
+          <name>NonCommittingChangeEvent</name>
+          <name>Transient</name>
+          <name>xobjTransient</name>
+      </keep-as3-metadata>
+     
+
+      <!-- Turn on reporting of data binding warnings. For example: Warning: Data binding -->
+      <!-- will not be able to detect assignments to "foo".                               -->
+      <show-binding-warnings>true</show-binding-warnings>
+
+      <!-- toggle whether warnings generated from unused type selectors are displayed -->
+      <show-unused-type-selector-warnings>true</show-unused-type-selector-warnings>
+
+      <!-- Run the AS3 compiler in strict error checking mode. -->
+      <strict>true</strict>
+
+      <!-- Use the ActionScript 3 class based object model for greater performance and better error reporting. -->
+      <!-- In the class based object model most built-in functions are implemented as fixed methods of classes -->
+      <!-- (-strict is recommended, but not required, for earlier errors) -->
+      <as3>true</as3>
+
+      <!-- Use the ECMAScript edition 3 prototype based object model to allow dynamic overriding of prototype -->
+      <!-- properties. In the prototype based object model built-in functions are implemented as dynamic      -->
+      <!-- properties of prototype objects (-strict is allowed, but may result in compiler errors for         -->
+      <!-- references to dynamic properties) -->
+      <es>false</es>
+
+      <!-- List of CSS or SWC files to apply as a theme. -->
+      <!-- not set -->
+      <!--
+      <theme>
+         <filename>string</filename>
+         <filename>string</filename>
+      </theme>
+      -->
+
+      <!-- Turns on the display of stack traces for uncaught runtime errors. -->
+      <verbose-stacktraces>false</verbose-stacktraces>
+
+      <!-- Defines the AS3 file encoding. -->
+      <!-- not set -->
+      <!--
+      <actionscript-file-encoding></actionscript-file-encoding>
+      -->
+
+      <fonts>
+
+          <!-- Enables advanced anti-aliasing for embedded fonts, which provides greater clarity for small -->
+          <!-- fonts. This setting can be overriden in CSS for specific fonts. -->
+          <!-- NOTE: flash-type has been deprecated. Please use advanced-anti-aliasing <flash-type>true</flash-type> -->
+          <advanced-anti-aliasing>true</advanced-anti-aliasing>
+
+          <!-- The number of embedded font faces that are cached. -->
+          <max-cached-fonts>20</max-cached-fonts>
+
+          <!-- The number of character glyph outlines to cache for each font face. -->
+          <max-glyphs-per-face>1000</max-glyphs-per-face>
+
+          <!-- Defines ranges that can be used across multiple font-face declarations. -->
+          <!-- See flash-unicode-table.xml for more examples. -->
+          <!-- not set -->
+          <!--
+          <languages>
+              <language-range>
+                  <lang>englishRange</lang>
+                  <range>U+0020-U+007E</range>
+              </language-range>
+          </languages>
+          -->
+
+          <!-- Compiler font manager classes, in policy resolution order-->
+          <managers>
+              <manager-class>flash.fonts.JREFontManager</manager-class>
+              <manager-class>flash.fonts.AFEFontManager</manager-class>
+              <manager-class>flash.fonts.BatikFontManager</manager-class>
+          </managers>
+
+          <!-- File containing cached system font licensing information produced via
+               java -cp mxmlc.jar flex2.tools.FontSnapshot (fontpath)
+               Will default to winFonts.ser on Windows XP and
+               macFonts.ser on Mac OS X, so is commented out by default.
+
+          <local-fonts-snapshot>localFonts.ser</local-fonts-snapshot>
+          -->
+
+      </fonts>
+
+      <!-- Array.toString() format has changed. -->
+      <warn-array-tostring-changes>false</warn-array-tostring-changes>
+
+      <!-- Assignment within conditional. -->
+      <warn-assignment-within-conditional>true</warn-assignment-within-conditional>
+
+      <!-- Possibly invalid Array cast operation. -->
+      <warn-bad-array-cast>true</warn-bad-array-cast>
+
+      <!-- Non-Boolean value used where a Boolean value was expected. -->
+      <warn-bad-bool-assignment>true</warn-bad-bool-assignment>
+
+      <!-- Invalid Date cast operation. -->
+      <warn-bad-date-cast>true</warn-bad-date-cast>
+
+      <!-- Unknown method. -->
+      <warn-bad-es3-type-method>true</warn-bad-es3-type-method>
+
+      <!-- Unknown property. -->
+      <warn-bad-es3-type-prop>true</warn-bad-es3-type-prop>
+
+      <!-- Illogical comparison with NaN. Any comparison operation involving NaN will evaluate to false because NaN != NaN. -->
+      <warn-bad-nan-comparison>true</warn-bad-nan-comparison>
+
+      <!-- Impossible assignment to null. -->
+      <warn-bad-null-assignment>true</warn-bad-null-assignment>
+
+      <!-- Illogical comparison with null. -->
+      <warn-bad-null-comparison>true</warn-bad-null-comparison>
+
+      <!-- Illogical comparison with undefined. Only untyped variables (or variables of type *) can be undefined. -->
+      <warn-bad-undefined-comparison>true</warn-bad-undefined-comparison>
+
+      <!-- Boolean() with no arguments returns false in ActionScript 3.0. Boolean() returned undefined in ActionScript 2.0. -->
+      <warn-boolean-constructor-with-no-args>false</warn-boolean-constructor-with-no-args>
+
+      <!-- __resolve is no longer supported. -->
+      <warn-changes-in-resolve>false</warn-changes-in-resolve>
+
+      <!-- Class is sealed. It cannot have members added to it dynamically. -->
+      <warn-class-is-sealed>true</warn-class-is-sealed>
+
+      <!-- Constant not initialized. -->
+      <warn-const-not-initialized>true</warn-const-not-initialized>
+
+      <!-- Function used in new expression returns a value. Result will be what the -->
+      <!-- function returns, rather than a new instance of that function.           -->
+      <warn-constructor-returns-value>false</warn-constructor-returns-value>
+
+      <!-- EventHandler was not added as a listener. -->
+      <warn-deprecated-event-handler-error>false</warn-deprecated-event-handler-error>
+
+      <!-- Unsupported ActionScript 2.0 function. -->
+      <warn-deprecated-function-error>true</warn-deprecated-function-error>
+
+      <!-- Unsupported ActionScript 2.0 property. -->
+      <warn-deprecated-property-error>true</warn-deprecated-property-error>
+
+      <!-- More than one argument by the same name. -->
+      <warn-duplicate-argument-names>true</warn-duplicate-argument-names>
+
+      <!-- Duplicate variable definition -->
+      <warn-duplicate-variable-def>true</warn-duplicate-variable-def>
+
+      <!-- ActionScript 3.0 iterates over an object's properties within a "for x in target" statement in random order. -->
+      <warn-for-var-in-changes>false</warn-for-var-in-changes>
+
+      <!-- Importing a package by the same name as the current class will hide that class identifier in this scope. -->
+      <warn-import-hides-class>true</warn-import-hides-class>
+
+      <!-- Use of the instanceof operator. -->
+      <warn-instance-of-changes>true</warn-instance-of-changes>
+
+      <!-- Internal error in compiler. -->
+      <warn-internal-error>true</warn-internal-error>
+
+      <!-- _level is no longer supported. For more information, see the flash.display package. -->
+      <warn-level-not-supported>true</warn-level-not-supported>
+
+      <!-- Missing namespace declaration (e.g. variable is not defined to be public, private, etc.). -->
+      <warn-missing-namespace-decl>true</warn-missing-namespace-decl>
+
+      <!-- Negative value will become a large positive value when assigned to a uint data type. -->
+      <warn-negative-uint-literal>true</warn-negative-uint-literal>
+
+      <!-- Missing constructor. -->
+      <warn-no-constructor>false</warn-no-constructor>
+
+      <!-- The super() statement was not called within the constructor. -->
+      <warn-no-explicit-super-call-in-constructor>false</warn-no-explicit-super-call-in-constructor>
+
+      <!-- Missing type declaration. -->
+      <warn-no-type-decl>true</warn-no-type-decl>
+
+      <!-- In ActionScript 3.0, white space is ignored and '' returns 0. Number() returns -->
+      <!-- NaN in ActionScript 2.0 when the parameter is '' or contains white space.      -->
+      <warn-number-from-string-changes>false</warn-number-from-string-changes>
+
+      <!-- Change in scoping for the this keyword. Class methods extracted from an  -->
+      <!-- instance of a class will always resolve this back to that instance. In   -->
+      <!-- ActionScript 2.0 this is looked up dynamically based on where the method -->
+      <!-- is invoked from.                                                         -->
+      <warn-scoping-change-in-this>false</warn-scoping-change-in-this>
+
+      <!-- Inefficient use of += on a TextField.-->
+      <warn-slow-text-field-addition>true</warn-slow-text-field-addition>
+
+      <!-- Possible missing parentheses. -->
+      <warn-unlikely-function-value>true</warn-unlikely-function-value>
+
+      <!-- Possible usage of the ActionScript 2.0 XML class. -->
+      <warn-xml-class-has-changed>false</warn-xml-class-has-changed>
+
+   </compiler>
+
+   <!-- compute-digest: writes a digest to the catalog.xml of a library. Use this when the library will be used as a
+                        cross-domain rsl.-->
+   <!-- compute-digest usage:
+   <compute-digest>boolean</compute-digest>
+   -->
+
+   <!-- A list of runtime shared library URLs to be loaded before applications start. -->
+   <!-- not set -->
+   <!--
+   <runtime-shared-libraries>
+      <url>string</url>
+      <url>string</url>
+   </runtime-shared-libraries>
+   -->
+
+   <!-- runtime-shared-library-path: specifies a SWC or directory to link against and an RSL URL to load with optional failover URLs -->
+   <runtime-shared-library-path>
+      <path-element>/opt/flex-sdk-3/frameworks/libs/framework.swc</path-element>
+      <rsl-url>framework_3.2.0.3958.swz</rsl-url>
+      <policy-file-url></policy-file-url>
+      <rsl-url>framework_3.2.0.3958.swf</rsl-url>
+      <policy-file-url></policy-file-url>
+   </runtime-shared-library-path>
+   <!-- static-link-runtime-shared-libraries: statically link the libraries specified by the -runtime-shared-libraries-path option.-->
+   <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
+
+   <!-- target-player: specifies the version of the player the application is targeting.
+                       Features requiring a later version will not be compiled into the application.
+                       The minimum value supported is "9.0.0".-->
+   <!-- target-player usage:
+   <target-player>version</target-player>
+   -->
+
+   <!-- Enables SWFs to access the network. -->
+   <use-network>true</use-network>
+
+   <!-- Metadata added to SWFs via the SWF Metadata tag. -->
+   <metadata>
+      <title>Adobe Flex 3 Application</title>
+      <description>http://www.adobe.com/products/flex</description>
+      <publisher>unknown</publisher>
+      <creator>unknown</creator>
+      <language>EN</language>
+   </metadata>
+
+   <!-- licenses: specifies a list of product and serial number pairs.
+   <licenses>
+      <license>
+         <product></product>
+         <serial-number></serial-number>
+      </license>
+   </licenses>
+   -->
+
+</flex-config>

From bmurphy@rpath.com Mon Mar 23 16:05:15 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2NK5F6V001310
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 20:05:15 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2NK5FSg027775
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 16:05:15 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2NK5E20012389
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 16:05:15 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2NK5E43028519
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 16:05:14 -0400
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2NK5DCw028514
	for xobj-commits@lists.rpath.com; Mon, 23 Mar 2009 16:05:13 -0400
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200903232005.n2NK5DCw028514@scc.eng.rpath.com>
Date: Mon, 23 Mar 2009 16:05:13 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Support decoding boolean values (with tests)
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 23 Mar 2009 20:05:15 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       as3/xobjas3-test/src/tests/TestBasics.as as3/xobjas3-test/src/tests/TestTransients.as as3/xobjas3-test/src/tests/models/TestableObject.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Support decoding boolean values (with tests)

diff -r 2614b0bf3898 -r c7e5675ae075 as3/xobjas3-test/src/tests/TestBasics.as
--- a/as3/xobjas3-test/src/tests/TestBasics.as	Wed Mar 18 15:18:48 2009 -0400
+++ b/as3/xobjas3-test/src/tests/TestBasics.as	Mon Mar 23 16:04:52 2009 -0400
@@ -187,6 +187,41 @@
     public function testId():void
     {
     }
+    
+    /** 
+     * Ensure boolean data is handled properly
+     */
+    public function testBoolean():void
+    {
+        var obj:TestableObject = new TestableObject();
+        obj.someVal = "someval";
+        obj.booleanVar = true;
+        var typeMap:* = {obj: TestableObject};
+        
+        var typedEncoder:XObjXMLEncoder = new XObjXMLEncoder(typeMap);
+        var xmlOutput:XMLDocument = typedEncoder.encodeObject(obj);
+
+        // neither the Transient nor the xobjTransient vars should be there
+        var expectedString:String = 
+                '<obj>\n'+
+                '  <booleanVar>true</booleanVar>\n'+
+                '  <someVal>someval</someVal>\n'+                
+                '</obj>\n';
+        
+        assertTrue(compareXMLtoString(xmlOutput, expectedString));
+        
+        // now decode it and validate
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder(typeMap);
+        var xmlInput:XMLDocument = xmlOutput;
+        var o:* = typedDecoder.decodeXML(xmlInput);
+        assertTrue(o.obj is TestableObject);
+        assertTrue(o.obj.someVal =="someval");
+        assertTrue(o.obj.booleanVar);
+        
+        // reencode and check round-trip
+        xmlOutput = typedEncoder.encodeObject(o);
+        assertTrue("encode matches input", compareXML(xmlOutput, xmlInput));
+    }
 
 }
 }
diff -r 2614b0bf3898 -r c7e5675ae075 as3/xobjas3-test/src/tests/TestTransients.as
--- a/as3/xobjas3-test/src/tests/TestTransients.as	Wed Mar 18 15:18:48 2009 -0400
+++ b/as3/xobjas3-test/src/tests/TestTransients.as	Mon Mar 23 16:04:52 2009 -0400
@@ -40,9 +40,10 @@
     
             // neither the Transient nor the xobjTransient vars should be there
             var expectedString:String = 
-                    '<obj>\n'+
-                    '  <someVal>someval</someVal>\n'+
-                    '</obj>\n';
+                '<obj>\n'+
+                '  <booleanVar>false</booleanVar>\n'+
+                '  <someVal>someval</someVal>\n'+                
+                '</obj>\n';
             
             assertTrue(compareXMLtoString(xmlOutput, expectedString));
             
diff -r 2614b0bf3898 -r c7e5675ae075 as3/xobjas3-test/src/tests/models/TestableObject.as
--- a/as3/xobjas3-test/src/tests/models/TestableObject.as	Wed Mar 18 15:18:48 2009 -0400
+++ b/as3/xobjas3-test/src/tests/models/TestableObject.as	Mon Mar 23 16:04:52 2009 -0400
@@ -25,5 +25,7 @@
         
         [xobjTransient]
         public var xobjTransientVar:String;
+        
+        public var booleanVar:Boolean;
     }
 }
\ No newline at end of file
diff -r 2614b0bf3898 -r c7e5675ae075 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Wed Mar 18 15:18:48 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon Mar 23 16:04:52 2009 -0400
@@ -324,7 +324,7 @@
 
             var temp:* = XObjXMLDecoder.simpleType(children[0].nodeValue);
             if (!isSpecifiedType || 
-                (result is String) || (resultTypeName == "com.rpath.xobj.XObjString") || (result is int) || (result is Number))
+                (result is String) || (resultTypeName == "com.rpath.xobj.XObjString") || (result is int) || (result is Number) || (result is Boolean))
             {
                 isSimpleType = true;
                 result = temp;

From bpja@rpath.com Mon Mar 23 16:43:29 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2NKhTTb001407
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 20:43:29 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2NKhTqg029599
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 16:43:29 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2NKhSYE014580
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 16:43:28 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2NKhSVJ030185
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 16:43:28 -0400
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2NKhSmo030180
	for xobj-commits@lists.rpath.com; Mon, 23 Mar 2009 16:43:28 -0400
From: Brett Adam <bpja@rpath.com>
Message-Id: <200903232043.n2NKhSmo030180@scc.eng.rpath.com>
Date: Mon, 23 Mar 2009 16:43:28 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Fix for handling of ArrayCollection as specfied type in
	client side types
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 23 Mar 2009 20:43:29 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Fix for handling of ArrayCollection as specfied type in client side types

diff -r c7e5675ae075 -r 544a5e8bee2e as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as	Mon Mar 23 16:04:52 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as	Mon Mar 23 16:43:25 2009 -0400
@@ -50,7 +50,7 @@
                    target[METADATA_PROPERTY] = new XObjMetadata();
                    result = target[METADATA_PROPERTY];
                }
-               catch (e:ReferenceError)
+               catch (e:Error)
                {
                    // must be nondynamic type
                }
diff -r c7e5675ae075 -r 544a5e8bee2e as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Mon Mar 23 16:04:52 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Mon Mar 23 16:43:25 2009 -0400
@@ -107,7 +107,7 @@
                 return false;
     
             var foo:* = new type();
-            return (type is ArrayCollection);
+            return (foo is ArrayCollection);
         }
         
         public static function typeInfoForProperty(className:String, propName:String):Object
diff -r c7e5675ae075 -r 544a5e8bee2e as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon Mar 23 16:04:52 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon Mar 23 16:43:25 2009 -0400
@@ -236,17 +236,19 @@
         
         */
         
+        isTypedProperty = (propType != null);
+        
+        var nodeType:Class = typeForTag(dataNode.nodeName);
+        isTypedNode = (nodeType != null);
+
         //TODO: make sure we don't obscure typeMap entries with
         // generic Array or ArrayCollection requests
-        if (XObjUtils.isTypeArray(propType) || XObjUtils.isTypeArrayCollection(propType))
+        if (isTypedNode && 
+            (XObjUtils.isTypeArray(propType) || XObjUtils.isTypeArrayCollection(propType)))
         {
             propType = nodeType;
         }
         
-        isTypedProperty = (propType != null);
-        
-        var nodeType:Class = typeForTag(dataNode.nodeName);
-        isTypedNode = (nodeType != null);
         
         isSpecifiedType = isTypedProperty || isTypedNode;
         
@@ -376,7 +378,7 @@
                     // TODO: allow type map entries to be full QNames, not just local names
                     var partName:* = decodePartName(partQName, partNode);
                     lastPartName.propname = partName;
-                                        
+
                     // what type do we want?
                     var typeInfo:Object = XObjUtils.typeInfoForProperty(resultTypeName, partName);
                     var partTypeName:String = typeInfo.typeName;
@@ -387,6 +389,7 @@
                     if (partTypeName != null)
                     {
                         var partClass:Class = XObjUtils.getClassByName(partTypeName);
+                        
                         if (partClass)
                             partObj = decodeXML(partNode, partClass);
                         else

From ewt@rpath.com Mon Mar 23 17:24:26 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2NLOQaA001583
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 21:24:26 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2NLOQi1031246
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 17:24:26 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2NLOPFM016742
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 17:24:25 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2NLOPqF031899
	for <xobj-commits@lists.rpath.com>; Mon, 23 Mar 2009 17:24:25 -0400
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2NLOPnw031893
	for xobj-commits@lists.rpath.com; Mon, 23 Mar 2009 17:24:25 -0400
From: Erik Troan <ewt@rpath.com>
Message-Id: <200903232124.n2NLOPnw031893@scc.eng.rpath.com>
Date: Mon, 23 Mar 2009 17:24:25 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: added tag parameter to XObjMetadata constructor
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 23 Mar 2009 21:24:26 -0000

tag:         tip
user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

added tag parameter to XObjMetadata constructor

diff -r 544a5e8bee2e -r 6db7e825e14c py/test/xobjtest.py
--- a/py/test/xobjtest.py	Mon Mar 23 16:43:25 2009 -0400
+++ b/py/test/xobjtest.py	Mon Mar 23 17:24:12 2009 -0400
@@ -772,6 +772,17 @@
         error = self.assertRaises(RuntimeError, xml.toxml)
         self.assertEquals(error.args, ('Document has no root element.',))
 
+    def testManualTag(self):
+        class Item(str):
+            _xobj = xobj.XObjMetadata(tag = 'item')
+
+        i = Item()
+        i.val = 10
+        s = xobj.toxml(i, None)
+        assert(s == "<?xml version='1.0' encoding='UTF-8'?>\n"
+                    "<item>\n"
+                    "  <val>10</val>\n"
+                    "</item>\n")
 
 if __name__ == "__main__":
     testsuite.main()
diff -r 544a5e8bee2e -r 6db7e825e14c py/xobj/xobj.py
--- a/py/xobj/xobj.py	Mon Mar 23 16:43:25 2009 -0400
+++ b/py/xobj/xobj.py	Mon Mar 23 17:24:12 2009 -0400
@@ -119,7 +119,8 @@
 
     __slots__ = [ 'elements', 'attributes', 'tag', 'text' ]
 
-    def __init__(self, elements = None, attributes = None, text = None):
+    def __init__(self, elements = None, attributes = None, text = None,
+                 tag = None):
         if elements:
             self.elements = list(elements)
         else:
@@ -133,7 +134,7 @@
         else:
             self.attributes = dict()
 
-        self.tag = None
+        self.tag = tag
         self.text = text
 
 class XID(XObj):

From bpja@rpath.com Tue Mar 24 02:50:13 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2O6oDtN003324
	for <xobj-commits@lists.rpath.com>; Tue, 24 Mar 2009 06:50:13 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2O6oDQK024401
	for <xobj-commits@lists.rpath.com>; Tue, 24 Mar 2009 02:50:13 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2O6oCtj013735
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 24 Mar 2009 02:50:12 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2O6oBVe017471
	for <xobj-commits@lists.rpath.com>; Tue, 24 Mar 2009 02:50:11 -0400
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2O6oBmr017466
	for xobj-commits@lists.rpath.com; Tue, 24 Mar 2009 02:50:11 -0400
From: Brett Adam <bpja@rpath.com>
Message-Id: <200903240650.n2O6oBmr017466@scc.eng.rpath.com>
Date: Tue, 24 Mar 2009 02:50:11 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: VERY nasty bug in Flex DescribeTypeCache. Pollution was
	happening due to use of classname rather than an instance
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 24 Mar 2009 06:50:13 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/.actionScriptProperties as3/xobjas3/.flexLibProperties as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

VERY nasty bug in Flex DescribeTypeCache. Pollution was happening due to use of classname rather than an instance

diff -r 6db7e825e14c -r 0e06c923ff16 as3/xobjas3/.actionScriptProperties
--- a/as3/xobjas3/.actionScriptProperties	Mon Mar 23 17:24:12 2009 -0400
+++ b/as3/xobjas3/.actionScriptProperties	Tue Mar 24 02:50:06 2009 -0400
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <actionScriptProperties mainApplicationPath="xobjas3.as" version="3">
-  <compiler additionalCompilerArguments="-keep-as3-metadata xobjTransient" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
-    <compilerSourcePath/>
-    <libraryPath defaultLinkType="1">
-      <libraryPathEntry kind="4" path=""/>
-    </libraryPath>
-    <sourceAttachmentPath/>
-  </compiler>
-  <applications>
-    <application path="xobjas3.as"/>
-  </applications>
-  <modules/>
-  <buildCSSFiles/>
+<compiler additionalCompilerArguments="-keep-as3-metadata+=ArrayElementType,xobjTransient" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+<compilerSourcePath/>
+<libraryPath defaultLinkType="1">
+<libraryPathEntry kind="4" path=""/>
+</libraryPath>
+<sourceAttachmentPath/>
+</compiler>
+<applications>
+<application path="xobjas3.as"/>
+</applications>
+<modules/>
+<buildCSSFiles/>
 </actionScriptProperties>
diff -r 6db7e825e14c -r 0e06c923ff16 as3/xobjas3/.flexLibProperties
--- a/as3/xobjas3/.flexLibProperties	Mon Mar 23 17:24:12 2009 -0400
+++ b/as3/xobjas3/.flexLibProperties	Tue Mar 24 02:50:06 2009 -0400
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <flexLibProperties version="1">
-  <includeClasses>
-    <classEntry path="com.rpath.xobj.XObjUtils"/>
-    <classEntry path="com.rpath.xobj.XObjXMLEncoder"/>
-    <classEntry path="com.rpath.xobj.XObjString"/>
-    <classEntry path="com.rpath.xobj.SchemaAwareXMLDecoder"/>
-    <classEntry path="com.rpath.xobj.XObjQName"/>
-    <classEntry path="com.rpath.xobj.XObjMetadata"/>
-    <classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
-    <classEntry path="com.rpath.xobj.XObjXMLDecoder"/>
-  </includeClasses>
-  <includeResources/>
-  <namespaceManifests/>
+<includeClasses>
+<classEntry path="com.rpath.xobj.XObjUtils"/>
+<classEntry path="com.rpath.xobj.XObjXMLEncoder"/>
+<classEntry path="com.rpath.xobj.XObjString"/>
+<classEntry path="com.rpath.xobj.SchemaAwareXMLDecoder"/>
+<classEntry path="com.rpath.xobj.XObjQName"/>
+<classEntry path="com.rpath.xobj.XObjMetadata"/>
+<classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
+<classEntry path="com.rpath.xobj.XObjXMLDecoder"/>
+</includeClasses>
+<includeResources/>
+<namespaceManifests/>
 </flexLibProperties>
diff -r 6db7e825e14c -r 0e06c923ff16 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Mon Mar 23 17:24:12 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Tue Mar 24 02:50:06 2009 -0400
@@ -110,7 +110,7 @@
             return (foo is ArrayCollection);
         }
         
-        public static function typeInfoForProperty(className:String, propName:String):Object
+        public static function typeInfoForProperty(object:*, className:String, propName:String):Object
         {
             var isArray:Boolean = false;
             var result:Object = {typeName: null, isArray: false, isArrayCollection: false};
@@ -128,7 +128,10 @@
                 result = {typeName: null, isArray: false, isArrayCollection: false};
                 
                 // go look it up (expensive)
-                var typeDesc:* = DescribeTypeCache.describeType(className);
+                // very important to use the instance object here, not the classname
+                // using the classname results in the typeInfo cache
+                // returning class not instance info later on! Bad cache!
+                var typeDesc:* = DescribeTypeCache.describeType(object);
                 var typeInfo:XML = typeDesc.typeDescription;
                 
                 result.typeName = typeInfo..accessor.(@name == propName).@type.toString().replace( /::/, "." );
diff -r 6db7e825e14c -r 0e06c923ff16 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon Mar 23 17:24:12 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Tue Mar 24 02:50:06 2009 -0400
@@ -380,7 +380,7 @@
                     lastPartName.propname = partName;
 
                     // what type do we want?
-                    var typeInfo:Object = XObjUtils.typeInfoForProperty(resultTypeName, partName);
+                    var typeInfo:Object = XObjUtils.typeInfoForProperty(result, resultTypeName, partName);
                     var partTypeName:String = typeInfo.typeName;
                     var propertyIsArray:Boolean = typeInfo.isArray;
                     var propertyIsArrayCollection:Boolean = typeInfo.isArrayCollection;

From mtharp@rpath.com Wed Mar 25 13:32:23 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2PHWNk1009870
	for <xobj-commits@lists.rpath.com>; Wed, 25 Mar 2009 17:32:23 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2PHWNqw029966
	for <xobj-commits@lists.rpath.com>; Wed, 25 Mar 2009 13:32:23 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2PHWNvm029932
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 25 Mar 2009 13:32:23 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2PHWMBA016011
	for <xobj-commits@lists.rpath.com>; Wed, 25 Mar 2009 13:32:22 -0400
Received: (from mtharp@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2PHWMS9016006
	for xobj-commits@lists.rpath.com; Wed, 25 Mar 2009 17:32:22 GMT
From: Michael Tharp <mtharp@rpath.com>
Message-Id: <200903251732.n2PHWMS9016006@scc.eng.rpath.com>
Date: Wed, 25 Mar 2009 17:32:22 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: [mq]: unicode
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 25 Mar 2009 17:32:24 -0000

tag:         tip
user:        Michael Tharp <mtharp@rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

[mq]: unicode

diff -r 0e06c923ff16 -r 03aacc2e16dc py/test/xobjtest.py
--- a/py/test/xobjtest.py	Tue Mar 24 02:50:06 2009 -0400
+++ b/py/test/xobjtest.py	Wed Mar 25 13:32:10 2009 -0400
@@ -784,5 +784,41 @@
                     "  <val>10</val>\n"
                     "</item>\n")
 
+
+    def testUnicodeIn(self):
+        doc = xobj.parse('<top>'
+                '<foo>m\xc3\xb8\xc3\xb8se bites are n\xc3\xa5sti</foo>'
+                '<bar asdf="\xe3\x81\xa7\xe3\x81\x99\xe3\x80\x9c" />'
+                '<baz ghjk="bl&#xEB;h" /></top>')
+        self.assertEquals(doc.top.foo, u'm\xf8\xf8se bites are n\xe5sti')
+        self.assertEquals(doc.top.bar.asdf, u'\u3067\u3059\u301c')
+        self.assertEquals(doc.top.baz.ghjk, u'bl\xebh')
+
+    def testUnicodeOut(self):
+        class Stuff(xobj.Document):
+            class top(xobj.XObj):
+                _xobj = xobj.XObjMetadata(attributes=['bar'])
+                foo = str
+        s = Stuff()
+        s.top = Stuff.top()
+
+        # Bad: non-ASCII str in text
+        s.top.foo = 'b\xc3\xa5d'
+        s.top.bar = 'good'
+        self.assertRaises(UnicodeDecodeError, s.toxml)
+
+        # Bad: non-ASCII str in attribute
+        s.top.foo = 'good'
+        s.top.bar = 'b\xc3\xa5d'
+        self.assertRaises(UnicodeDecodeError, s.toxml)
+
+        # Good: char string (unicode) for text and attribute
+        s.top.foo = u'\xf6'
+        s.top.bar = u'\xf6'
+        self.assertEquals(s.toxml(),
+                '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
+                '<top bar="&#xF6;">\n  <foo>\xc3\xb6</foo>\n</top>\n')
+
+
 if __name__ == "__main__":
     testsuite.main()
diff -r 0e06c923ff16 -r 03aacc2e16dc py/xobj/xobj.py
--- a/py/xobj/xobj.py	Tue Mar 24 02:50:06 2009 -0400
+++ b/py/xobj/xobj.py	Wed Mar 25 13:32:10 2009 -0400
@@ -75,7 +75,7 @@
 
     return XType(xObjectType)
 
-class XObj(str):
+class XObj(unicode):
 
     """
     Example class for all elements represented in XML. Subclasses of XObject
@@ -105,7 +105,7 @@
 
     def __repr__(self):
         if self:
-            return str.__repr__(self)
+            return unicode.__repr__(self)
         else:
             return object.__repr__(self)
 
@@ -170,10 +170,16 @@
         if xobj is None:
             return
 
-        if type(xobj) in (int, float):
-            xobj = str(xobj)
+        if type(xobj) in (int, long, float):
+            xobj = unicode(xobj)
 
         if type(xobj) == str:
+            # Only simple ASCII str are allowed, otherwise it
+            # *must* be a unicode object. This is consistent with ET
+            # and lxml, but forcing it here makes a better error.
+            xobj = xobj.decode('ascii')
+
+        if type(xobj) == unicode:
             element = etree.SubElement(parentElement, tag, {})
             element.text = xobj
             return element
@@ -226,7 +232,7 @@
 
                     if val is not None:
                         key = addns(key)
-                        attrs[key] = str(val)
+                        attrs[key] = unicode(val)
                 else:
                     l = elements.setdefault(key, [])
                     if type(val) == list:
@@ -262,8 +268,8 @@
             element = etree.SubElement(parentElement, tag, attrs)
 
 
-        if isinstance(xobj, str) and xobj:
-            element.text = str(xobj)
+        if isinstance(xobj, basestring) and xobj:
+            element.text = unicode(xobj)
         elif (hasattr(xobj, '_xobj') and xobj._xobj.text 
               and not orderedElements):
             # only add text if we don't have elements

From ewt@rpath.com Mon Mar 30 14:48:06 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n2UIm6VP000558
	for <xobj-commits@lists.rpath.com>; Mon, 30 Mar 2009 18:48:06 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n2UIm6Me023607
	for <xobj-commits@lists.rpath.com>; Mon, 30 Mar 2009 14:48:06 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n2UIm5XI008519
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 30 Mar 2009 14:48:05 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n2UIm5Yt012272
	for <xobj-commits@lists.rpath.com>; Mon, 30 Mar 2009 14:48:05 -0400
Received: (from ewt@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n2UIm4ZV012267
	for xobj-commits@lists.rpath.com; Mon, 30 Mar 2009 14:48:04 -0400
From: Erik Troan <ewt@rpath.com>
Message-Id: <200903301848.n2UIm4ZV012267@scc.eng.rpath.com>
Date: Mon, 30 Mar 2009 14:48:04 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: added support for longs
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 30 Mar 2009 18:48:06 -0000

tag:         tip
user:        Erik Troan <http://issues.rpath.com>
files:       py/test/xobjtest.py py/xobj/xobj.py

added support for longs

diff -r 03aacc2e16dc -r 6d3d4403cda2 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Wed Mar 25 13:32:10 2009 -0400
+++ b/py/test/xobjtest.py	Mon Mar 30 14:47:57 2009 -0400
@@ -820,5 +820,15 @@
                 '<top bar="&#xF6;">\n  <foo>\xc3\xb6</foo>\n</top>\n')
 
 
+    def testLong(self):
+        class Foo(object):
+            i = long
+
+        f = Foo()
+        f.i = 1 << 33
+        s = xobj.toxml(f, 'foo')
+        x = xobj.parse(s, typeMap = { 'foo' : Foo })
+        assert(x.foo.i == 1 << 33)
+
 if __name__ == "__main__":
     testsuite.main()
diff -r 03aacc2e16dc -r 6d3d4403cda2 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Wed Mar 25 13:32:10 2009 -0400
+++ b/py/xobj/xobj.py	Mon Mar 30 14:47:57 2009 -0400
@@ -66,6 +66,8 @@
         return XType(XObj)
     elif xObjectType == int:
         return XType(XObjInt)
+    elif xObjectType == long:
+        return XType(XObjLong)
     elif xObjectType == float:
         return XType(XObjFloat)
     elif type(xObjectType) == list:
@@ -113,6 +115,9 @@
     pass
 
 class XObjFloat(float):
+    pass
+
+class XObjLong(long):
     pass
 
 class XObjMetadata(object):

From bpja@rpath.com Fri Apr  3 23:32:20 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n343WK3N022013
	for <xobj-commits@lists.rpath.com>; Sat, 4 Apr 2009 03:32:20 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n343WKEC006699
	for <xobj-commits@lists.rpath.com>; Fri, 3 Apr 2009 23:32:20 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n343WJrP002816
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 3 Apr 2009 23:32:19 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n343WJnT025150
	for <xobj-commits@lists.rpath.com>; Fri, 3 Apr 2009 23:32:19 -0400
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n343WJ1D025145
	for xobj-commits@lists.rpath.com; Fri, 3 Apr 2009 23:32:19 -0400
From: Brett Adam <bpja@rpath.com>
Message-Id: <200904040332.n343WJ1D025145@scc.eng.rpath.com>
Date: Fri, 03 Apr 2009 23:32:19 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Fix for handling ArrayCollections declared directly
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Sat, 04 Apr 2009 03:32:20 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjUtils.as

Fix for handling ArrayCollections declared directly

diff -r 6d3d4403cda2 -r 985a68825136 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Mon Mar 30 14:47:57 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Fri Apr 03 23:32:15 2009 -0400
@@ -115,6 +115,9 @@
             var isArray:Boolean = false;
             var result:Object = {typeName: null, isArray: false, isArrayCollection: false};
             
+            if (propName == "label")
+                trace("stop");
+                
             if (className == "Object" || className == "mx.utils::ObjectProxy")
                 return result;
             
@@ -148,7 +151,7 @@
                     result.isArray = true;
                     result.typeName = null; // assume generic object unless told otherwise
                 }
-                else if (result.typeName == "ArrayCollection")
+                else if (result.typeName == "mx.collections.ArrayCollection")
                 {
                     result.isArrayCollection = true;
                     result.typeName = null; // assume generic object unless told otherwise

From bpja@rpath.com Sun Apr  5 14:38:25 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n35IcPCH028807
	for <xobj-commits@lists.rpath.com>; Sun, 5 Apr 2009 18:38:25 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n35IcPYs009793
	for <xobj-commits@lists.rpath.com>; Sun, 5 Apr 2009 14:38:25 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n35IcOOL027801
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Sun, 5 Apr 2009 14:38:25 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n35IcO8i016344
	for <xobj-commits@lists.rpath.com>; Sun, 5 Apr 2009 14:38:24 -0400
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n35IcOrC016339
	for xobj-commits@lists.rpath.com; Sun, 5 Apr 2009 14:38:24 -0400
From: Brett Adam <bpja@rpath.com>
Message-Id: <200904051838.n35IcOrC016339@scc.eng.rpath.com>
Date: Sun, 05 Apr 2009 14:38:24 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Remove debug trace
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Sun, 05 Apr 2009 18:38:25 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjUtils.as

Remove debug trace

diff -r 985a68825136 -r 4c6079408323 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Fri Apr 03 23:32:15 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Sun Apr 05 14:38:19 2009 -0400
@@ -114,10 +114,7 @@
         {
             var isArray:Boolean = false;
             var result:Object = {typeName: null, isArray: false, isArrayCollection: false};
-            
-            if (propName == "label")
-                trace("stop");
-                
+
             if (className == "Object" || className == "mx.utils::ObjectProxy")
                 return result;
             

From bmurphy@rpath.com Fri Apr 10 23:19:40 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3B3JdkK020448
	for <xobj-commits@lists.rpath.com>; Sat, 11 Apr 2009 03:19:39 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3B3JdaM002862
	for <xobj-commits@lists.rpath.com>; Fri, 10 Apr 2009 23:19:39 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3B3Jdsb022423
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 10 Apr 2009 23:19:39 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3B3JcUU001021
	for <xobj-commits@lists.rpath.com>; Fri, 10 Apr 2009 23:19:38 -0400
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3B3Jcbw001016
	for xobj-commits@lists.rpath.com; Fri, 10 Apr 2009 23:19:38 -0400
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200904110319.n3B3Jcbw001016@scc.eng.rpath.com>
Date: Fri, 10 Apr 2009 23:19:38 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Stamp xobj hg version/timestamp to XObjVersion.as
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Sat, 11 Apr 2009 03:19:40 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       as3/xobjas3/build.properties as3/xobjas3/build.xml as3/xobjas3/hg-version.sh as3/xobjas3/src/com/rpath/xobj/XObjVersion.as as3/xobjas3/src/xobj-manifest.xml

Stamp xobj hg version/timestamp to XObjVersion.as

diff -r 4c6079408323 -r 945d40a63238 as3/xobjas3/build.properties
--- a/as3/xobjas3/build.properties	Sun Apr 05 14:38:19 2009 -0400
+++ b/as3/xobjas3/build.properties	Fri Apr 10 23:19:22 2009 -0400
@@ -14,12 +14,19 @@
 xobj.dir=.
 xobj.src.dir=${xobj.dir}/src
 xobj.build.dir=${xobj.dir}/bin
+xobj.build.dir.version.file=${xobj.build.dir}/build.version
+xobj.build.dir.timestamp.file=${xobj.build.dir}/build.timestamp
+xobj.temp.src.dir=${xobj.build.dir}/src
 
 # xobj lib vars
 xobj.lib.name=xobjas3.swc
 xobj.lib=${xobj.build.dir}/${xobj.lib.name}
 xobj.manifest=${xobj.src.dir}/xobj-manifest.xml
 xobj.namespace=http://www.rpath.com/2009/xobj
+
+# build vars
+xobj.package.path=com/rpath/xobj
+xobj.hg-version.cmd=${xobj.dir}/hg-version.sh
 
 # Flex vars
 FLEX_HOME=/opt/flex-sdk-3/
diff -r 4c6079408323 -r 945d40a63238 as3/xobjas3/build.xml
--- a/as3/xobjas3/build.xml	Sun Apr 05 14:38:19 2009 -0400
+++ b/as3/xobjas3/build.xml	Fri Apr 10 23:19:22 2009 -0400
@@ -99,16 +99,53 @@
         </delete>
     	<echo>Cleaning completed</echo>
     </target>
+	
+	<target name="build-version" description="Create the build version and timestamp files">
+        <echo>Obtaining build version for ${ant.project.name}...</echo>
+        
+        <!-- Write the version from mercurial -->
+        <exec executable="${xobj.hg-version.cmd}" outputproperty="build.version"/>
+        <echo file="${xobj.build.dir.version.file}" message="${build.version}"/>
+        <loadfile property="build.info.version" srcFile="${xobj.build.dir.version.file}"/>
+        <echo>Current build version is ${build.info.version}</echo>
+        
+        <!-- Write the date/time stamp -->
+        <tstamp>
+            <format property="build.timestamp" pattern="MM/dd/yyyy HH:mm:ss"/>
+        </tstamp>
+        <echo file="${xobj.build.dir.timestamp.file}" message="${build.timestamp}"/>
+        <loadfile property="build.info.timestamp" srcFile="${xobj.build.dir.timestamp.file}"/>
+        <echo>Current build timestamp is ${build.info.timestamp}</echo>
+    </target>
 	    
     <target name="init" description="Initialization for building">
     	<mkdir dir="${xobj.build.dir}" />
+    	<mkdir dir="${xobj.temp.src.dir}" />
+    	<antcall target="build-version"/>
     </target>
     
     <target name="xobj-build" description="Build the xobj flex library">
+    	
+    	<!-- Copy the source dir to a new location so we can stamp version info
+             without having to worry about failure cases where the file
+             remains modified and gets checked in with an actual version
+             instead of the replacement token.-->
+        <copy todir="${xobj.temp.src.dir}">
+            <fileset dir="${xobj.src.dir}"/>
+        </copy>
+        
+        <!-- Stamp version info -->
+        <property name="tmpSrcFile" value="${xobj.temp.src.dir}/${xobj.package.path}/XObjVersion.as"/>
+        <loadfile property="build.version" srcFile="${xobj.build.dir.version.file}"/>
+        <loadfile property="build.timestamp" srcFile="${xobj.build.dir.timestamp.file}"/>
+        <property name="fullVersion" value="${build.version} (${build.timestamp})"/>
+        <echo>Stamping XObjVersion.as with build version "${fullVersion}"</echo>
+        <replace file="${xobj.temp.src.dir}/${xobj.package.path}/XObjVersion.as" token="@@XOBJ-BUILDVERSION@@" value="${fullVersion}"/>
+
     	<flexlib-build 
     		title="xobj" 
     		outputlib="${xobj.lib}"
-    		srcdir="${xobj.src.dir}"
+    		srcdir="${xobj.temp.src.dir}"
     		namespace="${xobj.namespace}"
     		manifest="${xobj.manifest}">    		
         </flexlib-build>
diff -r 4c6079408323 -r 945d40a63238 as3/xobjas3/hg-version.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3/hg-version.sh	Fri Apr 10 23:19:22 2009 -0400
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Copyright (c) 2009 rPath, Inc.
+# All rights reserved
+#
+# Get the build version for build.xml
+
+hgDir=../../
+if [[ -x /usr/bin/hg && -d $hgDir/.hg ]] ; then
+    rev=`hg id -i`
+elif [ -f $hgDir/.hg_archival.txt ]; then
+    rev=`grep node $hgDir/.hg_archival.txt |cut -d' ' -f 2 |head -c 12`;
+else
+    rev= ;
+fi ;
+echo "$rev"
+
diff -r 4c6079408323 -r 945d40a63238 as3/xobjas3/src/com/rpath/xobj/XObjVersion.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjVersion.as	Fri Apr 10 23:19:22 2009 -0400
@@ -0,0 +1,20 @@
+/*
+#
+# Copyright (c) 2009 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package com.rpath.xobj
+{    
+    public class XObjVersion
+    {
+        public static const VERSION:String = "@@XOBJ-BUILDVERSION@@";
+    }
+}
\ No newline at end of file
diff -r 4c6079408323 -r 945d40a63238 as3/xobjas3/src/xobj-manifest.xml
--- a/as3/xobjas3/src/xobj-manifest.xml	Sun Apr 05 14:38:19 2009 -0400
+++ b/as3/xobjas3/src/xobj-manifest.xml	Fri Apr 10 23:19:22 2009 -0400
@@ -19,6 +19,7 @@
     <component id="XObjQName" class="com.rpath.xobj.XObjQName"/>
     <component id="XObjString" class="com.rpath.xobj.XObjString"/>
     <component id="XObjUtils" class="com.rpath.xobj.XObjUtils"/>
+    <component id="XObjVersion" class="com.rpath.xobj.XObjVersion"/>
     <component id="XObjXMLDecoder" class="com.rpath.xobj.XObjXMLDecoder"/>
     <component id="XObjXMLEncoder" class="com.rpath.xobj.XObjXMLEncoder"/>
 </componentPackage>

From bmurphy@rpath.com Fri Apr 10 23:25:43 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3B3Phbk020458
	for <xobj-commits@lists.rpath.com>; Sat, 11 Apr 2009 03:25:43 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3B3Ph0d003043
	for <xobj-commits@lists.rpath.com>; Fri, 10 Apr 2009 23:25:43 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3B3Phr1022751
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 10 Apr 2009 23:25:43 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3B3PgJO001272
	for <xobj-commits@lists.rpath.com>; Fri, 10 Apr 2009 23:25:42 -0400
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3B3PeXp001266
	for xobj-commits@lists.rpath.com; Fri, 10 Apr 2009 23:25:40 -0400
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200904110325.n3B3PeXp001266@scc.eng.rpath.com>
Date: Fri, 10 Apr 2009 23:25:40 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Forgot to add XObjVersion.sh to .flex/.action* metadata
 files
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Sat, 11 Apr 2009 03:25:43 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       as3/xobjas3/.actionScriptProperties as3/xobjas3/.flexLibProperties

Forgot to add XObjVersion.sh to .flex/.action* metadata files

diff -r 945d40a63238 -r ed60a4b77d7b as3/xobjas3/.actionScriptProperties
--- a/as3/xobjas3/.actionScriptProperties	Fri Apr 10 23:19:22 2009 -0400
+++ b/as3/xobjas3/.actionScriptProperties	Fri Apr 10 23:25:21 2009 -0400
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <actionScriptProperties mainApplicationPath="xobjas3.as" version="3">
-<compiler additionalCompilerArguments="-keep-as3-metadata+=ArrayElementType,xobjTransient" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
-<compilerSourcePath/>
-<libraryPath defaultLinkType="1">
-<libraryPathEntry kind="4" path=""/>
-</libraryPath>
-<sourceAttachmentPath/>
-</compiler>
-<applications>
-<application path="xobjas3.as"/>
-</applications>
-<modules/>
-<buildCSSFiles/>
+  <compiler additionalCompilerArguments="-keep-as3-metadata+=ArrayElementType,xobjTransient" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="1">
+      <libraryPathEntry kind="4" path=""/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="xobjas3.as"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
 </actionScriptProperties>
diff -r 945d40a63238 -r ed60a4b77d7b as3/xobjas3/.flexLibProperties
--- a/as3/xobjas3/.flexLibProperties	Fri Apr 10 23:19:22 2009 -0400
+++ b/as3/xobjas3/.flexLibProperties	Fri Apr 10 23:25:21 2009 -0400
@@ -1,15 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <flexLibProperties version="1">
-<includeClasses>
-<classEntry path="com.rpath.xobj.XObjUtils"/>
-<classEntry path="com.rpath.xobj.XObjXMLEncoder"/>
-<classEntry path="com.rpath.xobj.XObjString"/>
-<classEntry path="com.rpath.xobj.SchemaAwareXMLDecoder"/>
-<classEntry path="com.rpath.xobj.XObjQName"/>
-<classEntry path="com.rpath.xobj.XObjMetadata"/>
-<classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
-<classEntry path="com.rpath.xobj.XObjXMLDecoder"/>
-</includeClasses>
-<includeResources/>
-<namespaceManifests/>
+  <includeClasses>
+    <classEntry path="com.rpath.xobj.SchemaAwareXMLDecoder"/>
+    <classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
+    <classEntry path="com.rpath.xobj.XObjMetadata"/>
+    <classEntry path="com.rpath.xobj.XObjQName"/>
+    <classEntry path="com.rpath.xobj.XObjString"/>
+    <classEntry path="com.rpath.xobj.XObjUtils"/>
+    <classEntry path="com.rpath.xobj.XObjVersion"/>
+    <classEntry path="com.rpath.xobj.XObjXMLDecoder"/>
+    <classEntry path="com.rpath.xobj.XObjXMLEncoder"/>
+  </includeClasses>
+  <includeResources/>
+  <namespaceManifests/>
 </flexLibProperties>

From bmurphy@rpath.com Mon Apr 13 11:08:14 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3DF8ER4031284
	for <xobj-commits@lists.rpath.com>; Mon, 13 Apr 2009 15:08:14 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3DF8EVk010614
	for <xobj-commits@lists.rpath.com>; Mon, 13 Apr 2009 11:08:14 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3DF8BY2032225
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 13 Apr 2009 11:08:11 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3DF8B86030429
	for <xobj-commits@lists.rpath.com>; Mon, 13 Apr 2009 11:08:11 -0400
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3DF8BLU030424
	for xobj-commits@lists.rpath.com; Mon, 13 Apr 2009 11:08:11 -0400
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200904131508.n3DF8BLU030424@scc.eng.rpath.com>
Date: Mon, 13 Apr 2009 11:08:11 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Get rid of our flex-config file, properly handle it in
	compc/mxmlc
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 13 Apr 2009 15:08:14 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       as3/xobjas3-test/build.xml as3/xobjas3/.actionScriptProperties as3/xobjas3/build.xml as3/xobjas3/xobj-flex-config.xml

Get rid of our flex-config file, properly handle it in compc/mxmlc

diff -r da9f6244d4c6 -r 66dfe07ae91b as3/xobjas3-test/build.xml
--- a/as3/xobjas3-test/build.xml	Mon Apr 13 09:26:13 2009 -0400
+++ b/as3/xobjas3-test/build.xml	Mon Apr 13 11:07:58 2009 -0400
@@ -56,7 +56,10 @@
             incremental="true" debug="true">
             
             <!-- Get default compiler options. -->
-            <load-config filename="${xobj.dir}/xobj-flex-config.xml"/>
+        	<load-config filename="${flex.sdk.frameworks.dir}/${flex-config.name}"/>
+        	
+        	<keep-as3-metadata name="xobjTransient"/>
+        	<keep-as3-metadata name="ArrayElementType"/>
     
             <!-- List of path elements that form the roots of ActionScript
             class hierarchies. -->
@@ -90,7 +93,10 @@
             incremental="true" debug="true">
             
             <!-- Get default compiler options. -->
-        	<load-config filename="${xobj.dir}/xobj-flex-config.xml"/>
+        	<load-config filename="${flex.sdk.frameworks.dir}/${flex-config.name}"/>
+        	
+        	<keep-as3-metadata name="xobjTransient"/>
+        	<keep-as3-metadata name="ArrayElementType"/>
     
             <!-- List of path elements that form the roots of ActionScript
             class hierarchies. -->
diff -r da9f6244d4c6 -r 66dfe07ae91b as3/xobjas3/.actionScriptProperties
--- a/as3/xobjas3/.actionScriptProperties	Mon Apr 13 09:26:13 2009 -0400
+++ b/as3/xobjas3/.actionScriptProperties	Mon Apr 13 11:07:58 2009 -0400
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <actionScriptProperties mainApplicationPath="xobjas3.as" version="3">
-  <compiler additionalCompilerArguments="-keep-as3-metadata+=ArrayElementType,xobjTransient" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+  <compiler additionalCompilerArguments="-keep-as3-metadata+=ArrayElementType,xobjTransient -dump-config=/tmp/foo.xml" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
     <compilerSourcePath/>
     <libraryPath defaultLinkType="1">
       <libraryPathEntry kind="4" path=""/>
diff -r da9f6244d4c6 -r 66dfe07ae91b as3/xobjas3/build.xml
--- a/as3/xobjas3/build.xml	Mon Apr 13 09:26:13 2009 -0400
+++ b/as3/xobjas3/build.xml	Mon Apr 13 11:07:58 2009 -0400
@@ -50,13 +50,6 @@
 			
     		<compc output="@{outputLib}">
     			
-    			<!-- 
-    			    Load our own config since ant compc is busted and doesn't
-    			    allow saving metadata.  The xobjTransient metadata tag
-    			    will not work without this. 
-    			-->
-    			<load-config filename="xobj-flex-config.xml"/>
-    			
     			<source-path path-element="@{srcDir}"/>
     			
     			<!-- Include libraries we need to link to -->
@@ -84,6 +77,7 @@
     			
     			<!-- Include the xobjTransient metadata tag -->
     			<keep-as3-metadata name="xobjTransient"/>
+    			<keep-as3-metadata name="ArrayElementType"/>
             </compc>
 			
             <echo>Build completed</echo>
diff -r da9f6244d4c6 -r 66dfe07ae91b as3/xobjas3/xobj-flex-config.xml
--- a/as3/xobjas3/xobj-flex-config.xml	Mon Apr 13 09:26:13 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,364 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright (c) 2009 rPath, Inc.
-
- This program is distributed under the terms of the MIT License as found 
- in a file called LICENSE. If it is not present, the license
- is always available at http://www.opensource.org/licenses/mit-license.php.
-
- This program is distributed in the hope that it will be useful, but
- without any waranty; without even the implied warranty of merchantability
- or fitness for a particular purpose. See the MIT License for full details.
- 
- <murf>  Note that we use our own config to support the xobjTransient
-         metadata tag.  There is a bug in ant compc preventing it from 
-         being usable there.
--->
-
-<flex-config>
-    <!-- Specifies the minimum player version that will run the compiled SWF. -->
-    <!-- 9.0.124 is the April 2008 security release -->
-    <target-player>9.0.124</target-player>
-
-   <compiler>
-
-      <!-- Turn on generation of accessible SWFs. -->
-      <accessible>false</accessible>
-
-      <!-- Specifies the locales for internationalization. -->
-      <locale>
-          <locale-element>en_US</locale-element>
-      </locale>
-
-      <!-- List of path elements that form the roots of ActionScript class hierarchies. -->
-      <!-- not set -->
-      <!--
-      <source-path>
-         <path-element>string</path-element>
-      </source-path>
-      -->
-
-     <!-- Allow the source-path to have path-elements which contain other path-elements -->
-     <allow-source-path-overlap>false</allow-source-path-overlap>
-
-      <!-- Run the AS3 compiler in a mode that detects legal but potentially incorrect -->
-      <!-- code.                                                                       -->
-      <show-actionscript-warnings>true</show-actionscript-warnings>
-
-      <!-- Turn on generation of debuggable SWFs. False by default for mxmlc, -->
-      <!-- but true by default for compc. -->
-      <!--
-      <debug>true</debug>
-      -->
-
-      <!-- List of SWC files or directories to compile against but to omit from -->
-      <!-- linking.                                                             -->
-      <external-library-path>
-          <path-element>/opt/flex-sdk-3/frameworks/libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>
-      </external-library-path>
-
-      <!-- Turn on writing of generated/*.as files to disk. These files are generated by -->
-      <!-- the compiler during mxml translation and are helpful with understanding and   -->
-      <!-- debugging Flex applications.                                                  -->
-      <keep-generated-actionscript>false</keep-generated-actionscript>
-
-      <!-- not set -->
-      <!--
-      <include-libraries>
-         <library>string</library>
-      </include-libraries>
-      -->
-
-      <!-- List of SWC files or directories that contain SWC files. -->
-      <library-path>
-         <path-element>/opt/flex-sdk-3/frameworks/libs</path-element>   
-		 <!-- keep the original location in the libpath for backwards-compatibility -->
-         <path-element>/opt/flex-sdk-3/frameworks/libs/player</path-element>
-         <path-element>/opt/flex-sdk-3/frameworks/libs/player/{targetPlayerMajorVersion}</path-element>    
-	     <path-element>/opt/flex-sdk-3/frameworks/locale/{locale}</path-element>
-      </library-path>
-
-      <namespaces>
-      <!-- Specify a URI to associate with a manifest of components for use as MXML -->
-      <!-- elements.                                                                -->
-         <namespace>
-            <uri>http://www.adobe.com/2006/mxml</uri>
-            <manifest>/opt/flex-sdk-3/frameworks/mxml-manifest.xml</manifest>
-         </namespace>
-      </namespaces>
-
-      <!-- Enable post-link SWF optimization. -->
-      <optimize>true</optimize>
-
-      <!-- Keep the following AS3 metadata in the bytecodes.                                             -->
-      <!-- Warning: For the data binding feature in the Flex framework to work properly,                 -->
-      <!--          the following metadata must be kept:                                                 -->
-      <!--          1. Bindable                                                                          -->
-      <!--          2. Managed                                                                           -->
-      <!--          3. ChangeEvent                                                                       -->
-      <!--          4. NonCommittingChangeEvent                                                          -->
-      <!--          5. Transient                                                                         -->
-      
-      <keep-as3-metadata>
-          <name>ArrayElementType</name>
-          <name>Bindable</name>
-          <name>Managed</name>
-          <name>ChangeEvent</name>
-          <name>NonCommittingChangeEvent</name>
-          <name>Transient</name>
-          <name>xobjTransient</name>
-      </keep-as3-metadata>
-     
-
-      <!-- Turn on reporting of data binding warnings. For example: Warning: Data binding -->
-      <!-- will not be able to detect assignments to "foo".                               -->
-      <show-binding-warnings>true</show-binding-warnings>
-
-      <!-- toggle whether warnings generated from unused type selectors are displayed -->
-      <show-unused-type-selector-warnings>true</show-unused-type-selector-warnings>
-
-      <!-- Run the AS3 compiler in strict error checking mode. -->
-      <strict>true</strict>
-
-      <!-- Use the ActionScript 3 class based object model for greater performance and better error reporting. -->
-      <!-- In the class based object model most built-in functions are implemented as fixed methods of classes -->
-      <!-- (-strict is recommended, but not required, for earlier errors) -->
-      <as3>true</as3>
-
-      <!-- Use the ECMAScript edition 3 prototype based object model to allow dynamic overriding of prototype -->
-      <!-- properties. In the prototype based object model built-in functions are implemented as dynamic      -->
-      <!-- properties of prototype objects (-strict is allowed, but may result in compiler errors for         -->
-      <!-- references to dynamic properties) -->
-      <es>false</es>
-
-      <!-- List of CSS or SWC files to apply as a theme. -->
-      <!-- not set -->
-      <!--
-      <theme>
-         <filename>string</filename>
-         <filename>string</filename>
-      </theme>
-      -->
-
-      <!-- Turns on the display of stack traces for uncaught runtime errors. -->
-      <verbose-stacktraces>false</verbose-stacktraces>
-
-      <!-- Defines the AS3 file encoding. -->
-      <!-- not set -->
-      <!--
-      <actionscript-file-encoding></actionscript-file-encoding>
-      -->
-
-      <fonts>
-
-          <!-- Enables advanced anti-aliasing for embedded fonts, which provides greater clarity for small -->
-          <!-- fonts. This setting can be overriden in CSS for specific fonts. -->
-          <!-- NOTE: flash-type has been deprecated. Please use advanced-anti-aliasing <flash-type>true</flash-type> -->
-          <advanced-anti-aliasing>true</advanced-anti-aliasing>
-
-          <!-- The number of embedded font faces that are cached. -->
-          <max-cached-fonts>20</max-cached-fonts>
-
-          <!-- The number of character glyph outlines to cache for each font face. -->
-          <max-glyphs-per-face>1000</max-glyphs-per-face>
-
-          <!-- Defines ranges that can be used across multiple font-face declarations. -->
-          <!-- See flash-unicode-table.xml for more examples. -->
-          <!-- not set -->
-          <!--
-          <languages>
-              <language-range>
-                  <lang>englishRange</lang>
-                  <range>U+0020-U+007E</range>
-              </language-range>
-          </languages>
-          -->
-
-          <!-- Compiler font manager classes, in policy resolution order-->
-          <managers>
-              <manager-class>flash.fonts.JREFontManager</manager-class>
-              <manager-class>flash.fonts.AFEFontManager</manager-class>
-              <manager-class>flash.fonts.BatikFontManager</manager-class>
-          </managers>
-
-          <!-- File containing cached system font licensing information produced via
-               java -cp mxmlc.jar flex2.tools.FontSnapshot (fontpath)
-               Will default to winFonts.ser on Windows XP and
-               macFonts.ser on Mac OS X, so is commented out by default.
-
-          <local-fonts-snapshot>localFonts.ser</local-fonts-snapshot>
-          -->
-
-      </fonts>
-
-      <!-- Array.toString() format has changed. -->
-      <warn-array-tostring-changes>false</warn-array-tostring-changes>
-
-      <!-- Assignment within conditional. -->
-      <warn-assignment-within-conditional>true</warn-assignment-within-conditional>
-
-      <!-- Possibly invalid Array cast operation. -->
-      <warn-bad-array-cast>true</warn-bad-array-cast>
-
-      <!-- Non-Boolean value used where a Boolean value was expected. -->
-      <warn-bad-bool-assignment>true</warn-bad-bool-assignment>
-
-      <!-- Invalid Date cast operation. -->
-      <warn-bad-date-cast>true</warn-bad-date-cast>
-
-      <!-- Unknown method. -->
-      <warn-bad-es3-type-method>true</warn-bad-es3-type-method>
-
-      <!-- Unknown property. -->
-      <warn-bad-es3-type-prop>true</warn-bad-es3-type-prop>
-
-      <!-- Illogical comparison with NaN. Any comparison operation involving NaN will evaluate to false because NaN != NaN. -->
-      <warn-bad-nan-comparison>true</warn-bad-nan-comparison>
-
-      <!-- Impossible assignment to null. -->
-      <warn-bad-null-assignment>true</warn-bad-null-assignment>
-
-      <!-- Illogical comparison with null. -->
-      <warn-bad-null-comparison>true</warn-bad-null-comparison>
-
-      <!-- Illogical comparison with undefined. Only untyped variables (or variables of type *) can be undefined. -->
-      <warn-bad-undefined-comparison>true</warn-bad-undefined-comparison>
-
-      <!-- Boolean() with no arguments returns false in ActionScript 3.0. Boolean() returned undefined in ActionScript 2.0. -->
-      <warn-boolean-constructor-with-no-args>false</warn-boolean-constructor-with-no-args>
-
-      <!-- __resolve is no longer supported. -->
-      <warn-changes-in-resolve>false</warn-changes-in-resolve>
-
-      <!-- Class is sealed. It cannot have members added to it dynamically. -->
-      <warn-class-is-sealed>true</warn-class-is-sealed>
-
-      <!-- Constant not initialized. -->
-      <warn-const-not-initialized>true</warn-const-not-initialized>
-
-      <!-- Function used in new expression returns a value. Result will be what the -->
-      <!-- function returns, rather than a new instance of that function.           -->
-      <warn-constructor-returns-value>false</warn-constructor-returns-value>
-
-      <!-- EventHandler was not added as a listener. -->
-      <warn-deprecated-event-handler-error>false</warn-deprecated-event-handler-error>
-
-      <!-- Unsupported ActionScript 2.0 function. -->
-      <warn-deprecated-function-error>true</warn-deprecated-function-error>
-
-      <!-- Unsupported ActionScript 2.0 property. -->
-      <warn-deprecated-property-error>true</warn-deprecated-property-error>
-
-      <!-- More than one argument by the same name. -->
-      <warn-duplicate-argument-names>true</warn-duplicate-argument-names>
-
-      <!-- Duplicate variable definition -->
-      <warn-duplicate-variable-def>true</warn-duplicate-variable-def>
-
-      <!-- ActionScript 3.0 iterates over an object's properties within a "for x in target" statement in random order. -->
-      <warn-for-var-in-changes>false</warn-for-var-in-changes>
-
-      <!-- Importing a package by the same name as the current class will hide that class identifier in this scope. -->
-      <warn-import-hides-class>true</warn-import-hides-class>
-
-      <!-- Use of the instanceof operator. -->
-      <warn-instance-of-changes>true</warn-instance-of-changes>
-
-      <!-- Internal error in compiler. -->
-      <warn-internal-error>true</warn-internal-error>
-
-      <!-- _level is no longer supported. For more information, see the flash.display package. -->
-      <warn-level-not-supported>true</warn-level-not-supported>
-
-      <!-- Missing namespace declaration (e.g. variable is not defined to be public, private, etc.). -->
-      <warn-missing-namespace-decl>true</warn-missing-namespace-decl>
-
-      <!-- Negative value will become a large positive value when assigned to a uint data type. -->
-      <warn-negative-uint-literal>true</warn-negative-uint-literal>
-
-      <!-- Missing constructor. -->
-      <warn-no-constructor>false</warn-no-constructor>
-
-      <!-- The super() statement was not called within the constructor. -->
-      <warn-no-explicit-super-call-in-constructor>false</warn-no-explicit-super-call-in-constructor>
-
-      <!-- Missing type declaration. -->
-      <warn-no-type-decl>true</warn-no-type-decl>
-
-      <!-- In ActionScript 3.0, white space is ignored and '' returns 0. Number() returns -->
-      <!-- NaN in ActionScript 2.0 when the parameter is '' or contains white space.      -->
-      <warn-number-from-string-changes>false</warn-number-from-string-changes>
-
-      <!-- Change in scoping for the this keyword. Class methods extracted from an  -->
-      <!-- instance of a class will always resolve this back to that instance. In   -->
-      <!-- ActionScript 2.0 this is looked up dynamically based on where the method -->
-      <!-- is invoked from.                                                         -->
-      <warn-scoping-change-in-this>false</warn-scoping-change-in-this>
-
-      <!-- Inefficient use of += on a TextField.-->
-      <warn-slow-text-field-addition>true</warn-slow-text-field-addition>
-
-      <!-- Possible missing parentheses. -->
-      <warn-unlikely-function-value>true</warn-unlikely-function-value>
-
-      <!-- Possible usage of the ActionScript 2.0 XML class. -->
-      <warn-xml-class-has-changed>false</warn-xml-class-has-changed>
-
-   </compiler>
-
-   <!-- compute-digest: writes a digest to the catalog.xml of a library. Use this when the library will be used as a
-                        cross-domain rsl.-->
-   <!-- compute-digest usage:
-   <compute-digest>boolean</compute-digest>
-   -->
-
-   <!-- A list of runtime shared library URLs to be loaded before applications start. -->
-   <!-- not set -->
-   <!--
-   <runtime-shared-libraries>
-      <url>string</url>
-      <url>string</url>
-   </runtime-shared-libraries>
-   -->
-
-   <!-- runtime-shared-library-path: specifies a SWC or directory to link against and an RSL URL to load with optional failover URLs -->
-   <runtime-shared-library-path>
-      <path-element>/opt/flex-sdk-3/frameworks/libs/framework.swc</path-element>
-      <rsl-url>framework_3.2.0.3958.swz</rsl-url>
-      <policy-file-url></policy-file-url>
-      <rsl-url>framework_3.2.0.3958.swf</rsl-url>
-      <policy-file-url></policy-file-url>
-   </runtime-shared-library-path>
-   <!-- static-link-runtime-shared-libraries: statically link the libraries specified by the -runtime-shared-libraries-path option.-->
-   <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
-
-   <!-- target-player: specifies the version of the player the application is targeting.
-                       Features requiring a later version will not be compiled into the application.
-                       The minimum value supported is "9.0.0".-->
-   <!-- target-player usage:
-   <target-player>version</target-player>
-   -->
-
-   <!-- Enables SWFs to access the network. -->
-   <use-network>true</use-network>
-
-   <!-- Metadata added to SWFs via the SWF Metadata tag. -->
-   <metadata>
-      <title>Adobe Flex 3 Application</title>
-      <description>http://www.adobe.com/products/flex</description>
-      <publisher>unknown</publisher>
-      <creator>unknown</creator>
-      <language>EN</language>
-   </metadata>
-
-   <!-- licenses: specifies a list of product and serial number pairs.
-   <licenses>
-      <license>
-         <product></product>
-         <serial-number></serial-number>
-      </license>
-   </licenses>
-   -->
-
-</flex-config>

From bmurphy@rpath.com Mon Apr 13 11:08:24 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3DF8OFV031290
	for <xobj-commits@lists.rpath.com>; Mon, 13 Apr 2009 15:08:24 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3DF8OFY010625
	for <xobj-commits@lists.rpath.com>; Mon, 13 Apr 2009 11:08:24 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3DF8NAX032233
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 13 Apr 2009 11:08:23 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3DF8M9v030442
	for <xobj-commits@lists.rpath.com>; Mon, 13 Apr 2009 11:08:23 -0400
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3DDRedw027540
	for xobj-commits@lists.rpath.com; Mon, 13 Apr 2009 09:27:40 -0400
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200904131327.n3DDRedw027540@scc.eng.rpath.com>
Date: Mon, 13 Apr 2009 09:27:39 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Keep ArrayElementType as3 metadata
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 13 Apr 2009 15:08:24 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       as3/xobjas3/xobj-flex-config.xml

Keep ArrayElementType as3 metadata

diff -r ed60a4b77d7b -r da9f6244d4c6 as3/xobjas3/xobj-flex-config.xml
--- a/as3/xobjas3/xobj-flex-config.xml	Fri Apr 10 23:25:21 2009 -0400
+++ b/as3/xobjas3/xobj-flex-config.xml	Mon Apr 13 09:26:13 2009 -0400
@@ -101,6 +101,7 @@
       <!--          5. Transient                                                                         -->
       
       <keep-as3-metadata>
+          <name>ArrayElementType</name>
           <name>Bindable</name>
           <name>Managed</name>
           <name>ChangeEvent</name>

From bpja@rpath.com Tue Apr 14 17:37:51 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3ELbpfD004589
	for <xobj-commits@lists.rpath.com>; Tue, 14 Apr 2009 21:37:51 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3ELbpGX026579
	for <xobj-commits@lists.rpath.com>; Tue, 14 Apr 2009 17:37:51 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3ELboXV017335
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 14 Apr 2009 17:37:50 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3ELboZ3027233
	for <xobj-commits@lists.rpath.com>; Tue, 14 Apr 2009 17:37:50 -0400
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3ELboqn027222
	for xobj-commits@lists.rpath.com; Tue, 14 Apr 2009 17:37:50 -0400
From: Brett Adam <bpja@rpath.com>
Message-Id: <200904142137.n3ELboqn027222@scc.eng.rpath.com>
Date: Tue, 14 Apr 2009 17:37:46 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Allow ArrayCollections to be encoded on the wire as simple
	Arrays
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 14 Apr 2009 21:37:51 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as

Allow ArrayCollections to be encoded on the wire as simple Arrays

diff -r 66dfe07ae91b -r 205aeb561ca0 as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as	Mon Apr 13 11:07:58 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as	Tue Apr 14 17:36:59 2009 -0400
@@ -32,6 +32,8 @@
 
 import flash.utils.*;
 import flash.xml.*;
+
+import mx.collections.ArrayCollection;
 import mx.utils.*;
 
     
@@ -642,6 +644,8 @@
             return XObjXMLEncoder.DATE_TYPE;
         else if (obj is Array)
             return XObjXMLEncoder.ARRAY_TYPE;
+        else if (obj is ArrayCollection)
+            return XObjXMLEncoder.ARRAY_TYPE;
         else if (obj is Function)
             return XObjXMLEncoder.FUNCTION_TYPE;
         else if (obj is Object)

From bpja@rpath.com Thu Apr 16 02:24:36 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3G6Oaj9010641
	for <xobj-commits@lists.rpath.com>; Thu, 16 Apr 2009 06:24:36 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3G6Oa0M013082
	for <xobj-commits@lists.rpath.com>; Thu, 16 Apr 2009 02:24:36 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3G6OYmt007717
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 16 Apr 2009 02:24:34 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3G6OWfL022588
	for <xobj-commits@lists.rpath.com>; Thu, 16 Apr 2009 02:24:33 -0400
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3G6OWrN022583
	for xobj-commits@lists.rpath.com; Thu, 16 Apr 2009 02:24:32 -0400
From: Brett Adam <bpja@rpath.com>
Message-Id: <200904160624.n3G6OWrN022583@scc.eng.rpath.com>
Date: Thu, 16 Apr 2009 02:24:31 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Allow for decoding directly into a target object. Useful
	for GET on existing instance. Also,
	allow deferred XML decoding (required for first feature)
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 16 Apr 2009 06:24:36 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/.actionScriptProperties as3/xobjas3/.flexLibProperties as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Allow for decoding directly into a target object. Useful for GET on existing instance. Also, allow deferred XML decoding (required for first feature)

diff -r 205aeb561ca0 -r c4a674fd6685 as3/xobjas3/.actionScriptProperties
--- a/as3/xobjas3/.actionScriptProperties	Tue Apr 14 17:36:59 2009 -0400
+++ b/as3/xobjas3/.actionScriptProperties	Thu Apr 16 02:24:24 2009 -0400
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <actionScriptProperties mainApplicationPath="xobjas3.as" version="3">
-  <compiler additionalCompilerArguments="-keep-as3-metadata+=ArrayElementType,xobjTransient -dump-config=/tmp/foo.xml" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
-    <compilerSourcePath/>
-    <libraryPath defaultLinkType="1">
-      <libraryPathEntry kind="4" path=""/>
-    </libraryPath>
-    <sourceAttachmentPath/>
-  </compiler>
-  <applications>
-    <application path="xobjas3.as"/>
-  </applications>
-  <modules/>
-  <buildCSSFiles/>
+<compiler additionalCompilerArguments="-keep-as3-metadata+=ArrayElementType,xobjTransient -dump-config=/tmp/foo.xml" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+<compilerSourcePath/>
+<libraryPath defaultLinkType="1">
+<libraryPathEntry kind="4" path=""/>
+</libraryPath>
+<sourceAttachmentPath/>
+</compiler>
+<applications>
+<application path="xobjas3.as"/>
+</applications>
+<modules/>
+<buildCSSFiles/>
 </actionScriptProperties>
diff -r 205aeb561ca0 -r c4a674fd6685 as3/xobjas3/.flexLibProperties
--- a/as3/xobjas3/.flexLibProperties	Tue Apr 14 17:36:59 2009 -0400
+++ b/as3/xobjas3/.flexLibProperties	Thu Apr 16 02:24:24 2009 -0400
@@ -1,16 +1,17 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <flexLibProperties version="1">
-  <includeClasses>
-    <classEntry path="com.rpath.xobj.SchemaAwareXMLDecoder"/>
-    <classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
-    <classEntry path="com.rpath.xobj.XObjMetadata"/>
-    <classEntry path="com.rpath.xobj.XObjQName"/>
-    <classEntry path="com.rpath.xobj.XObjString"/>
-    <classEntry path="com.rpath.xobj.XObjUtils"/>
-    <classEntry path="com.rpath.xobj.XObjVersion"/>
-    <classEntry path="com.rpath.xobj.XObjXMLDecoder"/>
-    <classEntry path="com.rpath.xobj.XObjXMLEncoder"/>
-  </includeClasses>
-  <includeResources/>
-  <namespaceManifests/>
+<includeClasses>
+<classEntry path="com.rpath.xobj.XObjUtils"/>
+<classEntry path="com.rpath.xobj.XObjXMLEncoder"/>
+<classEntry path="com.rpath.xobj.XObjDeferredDecode"/>
+<classEntry path="com.rpath.xobj.XObjString"/>
+<classEntry path="com.rpath.xobj.SchemaAwareXMLDecoder"/>
+<classEntry path="com.rpath.xobj.XObjVersion"/>
+<classEntry path="com.rpath.xobj.XObjQName"/>
+<classEntry path="com.rpath.xobj.XObjMetadata"/>
+<classEntry path="com.rpath.xobj.XObjXMLDecoder"/>
+<classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
+</includeClasses>
+<includeResources/>
+<namespaceManifests/>
 </flexLibProperties>
diff -r 205aeb561ca0 -r c4a674fd6685 as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as	Thu Apr 16 02:24:24 2009 -0400
@@ -0,0 +1,33 @@
+package com.rpath.xobj
+{
+    import flash.utils.getDefinitionByName;
+    import flash.utils.getQualifiedClassName;
+    import flash.xml.XMLNode;
+    
+    public class XObjDeferredDecode
+    {
+        public function XObjDeferredDecode(xmlDecoder:XObjXMLDecoder, dataNode:XMLNode, propType:Class)
+        {
+            super();
+            this.decoder = xmlDecoder;
+            this.dataNode = dataNode;
+            this.propType = propType;
+        }
+
+        public var decoder:XObjXMLDecoder;
+        public var dataNode:XMLNode;
+        public var propType:Class;
+
+        
+        public function decodeXML():Object
+        {
+            return decoder.actualDecodeXML(dataNode, propType);
+        }
+
+        public function decodeXMLIntoObject(rootObject:*):Object
+        {
+            return decoder.actualDecodeXML(dataNode, null, rootObject);
+        }
+        
+    }
+}
\ No newline at end of file
diff -r 205aeb561ca0 -r c4a674fd6685 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Tue Apr 14 17:36:59 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Thu Apr 16 02:24:24 2009 -0400
@@ -48,6 +48,7 @@
    
 import flash.utils.Dictionary;
 import flash.utils.getQualifiedClassName;
+import flash.xml.XMLDocument;
 import flash.xml.XMLNode;
 import flash.xml.XMLNodeType;
 
@@ -181,7 +182,8 @@
      */
     public function XObjXMLDecoder(typeMap:* = null, nmMap:* = null,
             makeObjectsBindable:Boolean = false,
-            makeAttributesMeta:Boolean = false)
+            makeAttributesMeta:Boolean = false,
+            defer:Boolean=false)
     {
         super();
         this.typeMap = typeMap;
@@ -194,8 +196,11 @@
         
         this.makeObjectsBindable = makeObjectsBindable;
         this.makeAttributesMeta = makeAttributesMeta;
+        this.deferred = defer;
     }
 
+    public var deferred:Boolean;
+    
     //--------------------------------------------------------------------------
     //
     //  Methods
@@ -211,6 +216,15 @@
      */
     public function decodeXML(dataNode:XMLNode, propType:Class = null):Object
     {
+        if (!deferred)
+            return actualDecodeXML(dataNode, propType);
+        else
+            return new XObjDeferredDecode(this, dataNode, propType);
+    }
+
+
+    public function actualDecodeXML(dataNode:XMLNode, propType:Class = null, rootObject:* = null, isRootNode:Boolean = false):Object
+    {
         var result:*;
         var nullObject:Boolean;
         var isSimpleType:Boolean = false;
@@ -220,9 +234,14 @@
         var isSpecifiedType:Boolean = false;
         var elementSet:Array = [];
         var attributeSet:Array = [];
+        var nextNodeIsRoot:Boolean = false;
+        var doneRootDupe:Boolean = false;
         
         if (dataNode == null)
             return null;
+        
+        if (dataNode is XMLDocument)
+            nextNodeIsRoot = true;
             
         var children:Array = dataNode.childNodes;
 
@@ -301,10 +320,16 @@
                     
         }
         
-        // OK, so now we know what type to instantiate
-        
-        result = new resultType();
-        
+        // OK, so now we know what type we want
+        if (rootObject && isRootNode)
+        {
+            result = rootObject;
+        }
+        else
+        {
+            result = new resultType();
+        }
+
         // track whether we actually have any values at all
         nullObject = true;
         
@@ -391,12 +416,12 @@
                         var partClass:Class = XObjUtils.getClassByName(partTypeName);
                         
                         if (partClass)
-                            partObj = decodeXML(partNode, partClass);
+                            partObj = actualDecodeXML(partNode, partClass, rootObject, nextNodeIsRoot);
                         else
-                            partObj = decodeXML(partNode);
+                            partObj = actualDecodeXML(partNode, null, rootObject, nextNodeIsRoot);
                     }
                     else
-                        partObj = decodeXML(partNode);
+                        partObj = actualDecodeXML(partNode, null, rootObject, nextNodeIsRoot);
                         
                     // if we've seen this property before, assume it's an Array
                     if (seenProperties[partName])
@@ -405,7 +430,14 @@
                     }
                     
                     assign(result, partName, partObj, propertyIsArray, propertyIsArrayCollection, shouldMakeBindable);
-    
+                    
+                    // should we keep an extra, well-known ref to the object?
+                    if (nextNodeIsRoot && !doneRootDupe)
+                    {
+                        assign(result, "root", partObj, propertyIsArray, propertyIsArrayCollection, shouldMakeBindable);
+                        doneRootDupe = true;
+                    }
+                    
                     seenProperties[partName] = true;
                 }
             }

From jslagle@rpath.com Thu Apr 16 16:07:17 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3GK7H2V013375
	for <xobj-commits@lists.rpath.com>; Thu, 16 Apr 2009 20:07:17 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3GK7HJ4004380
	for <xobj-commits@lists.rpath.com>; Thu, 16 Apr 2009 16:07:17 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3GK7HBB026179
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 16 Apr 2009 16:07:17 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3GK7GQT017067
	for <xobj-commits@lists.rpath.com>; Thu, 16 Apr 2009 16:07:16 -0400
Received: (from jslagle@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3GK7Gdn017061
	for xobj-commits@lists.rpath.com; Thu, 16 Apr 2009 16:07:16 -0400
From: James Slagle <jslagle@rpath.com>
Message-Id: <200904162007.n3GK7Gdn017061@scc.eng.rpath.com>
Date: Thu, 16 Apr 2009 16:07:16 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Fix a couple bugs.
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 16 Apr 2009 20:07:18 -0000

tag:         tip
user:        James Slagle <https://issues.rpath.com>
files:       py/xobj/xobj.py

Fix a couple bugs.
1. need to apply the namespace before returning from getElementTree
2. allow a namespace map to be passed into toxml
3. Use the Document class's nameSpaceMap object with ElementGenerator
 if one has been set.

diff -r c4a674fd6685 -r 6f078fab750d py/xobj/xobj.py
--- a/py/xobj/xobj.py	Thu Apr 16 02:24:24 2009 -0400
+++ b/py/xobj/xobj.py	Thu Apr 16 16:07:10 2009 -0400
@@ -175,6 +175,8 @@
         if xobj is None:
             return
 
+        tag = addns(tag)
+
         if type(xobj) in (int, long, float):
             xobj = unicode(xobj)
 
@@ -189,7 +191,6 @@
             element.text = xobj
             return element
 
-        tag = addns(tag)
 
         if hasattr(xobj, '_xobj'):
             attrSet = xobj._xobj.attributes
@@ -330,7 +331,9 @@
             raise RuntimeError("Document has no root element.")
         rootName, rootValue = items[0]
 
-        if self.__explicitNamespaces:
+        if self.nameSpaceMap:
+            map = self.nameSpaceMap
+        elif self.__explicitNamespaces:
             map = self.__xmlNsMap.copy()
             del map[None]
         else:
@@ -588,13 +591,13 @@
     return parsef(s, schemaf, documentClass = documentClass, typeMap = typeMap)
 
 def toxml(xobj, tag, prettyPrint = True, xml_declaration = True,
-          schemaf = None):
+          schemaf = None, nsmap = {}):
     if schemaf:
         schemaObj = etree.XMLSchema(file = schemaf)
     else:
         schemaObj = None
 
-    gen = ElementGenerator(xobj, tag, schema = schemaObj)
+    gen = ElementGenerator(xobj, tag, schema = schemaObj, nsmap = nsmap)
 
     return gen.tostring(prettyPrint = prettyPrint,
                         xml_declaration = xml_declaration)

From jslagle@rpath.com Fri Apr 17 11:28:08 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3HFS8CC017532
	for <xobj-commits@lists.rpath.com>; Fri, 17 Apr 2009 15:28:08 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3HFS8gg002847
	for <xobj-commits@lists.rpath.com>; Fri, 17 Apr 2009 11:28:08 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3HFS7xB026784
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 17 Apr 2009 11:28:08 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3HFS5qS022792
	for <xobj-commits@lists.rpath.com>; Fri, 17 Apr 2009 11:28:05 -0400
Received: (from jslagle@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3HFS4RL022787
	for xobj-commits@lists.rpath.com; Fri, 17 Apr 2009 11:28:04 -0400
From: James Slagle <jslagle@rpath.com>
Message-Id: <200904171528.n3HFS4RL022787@scc.eng.rpath.com>
Date: Fri, 17 Apr 2009 11:28:04 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Make use of the nsmap variable passed into the function
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 17 Apr 2009 15:28:08 -0000

tag:         tip
user:        James Slagle <https://issues.rpath.com>
files:       py/xobj/xobj.py

Make use of the nsmap variable passed into the function

diff -r 6f078fab750d -r 415cd41f1720 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Thu Apr 16 16:07:10 2009 -0400
+++ b/py/xobj/xobj.py	Fri Apr 17 11:27:54 2009 -0400
@@ -331,13 +331,14 @@
             raise RuntimeError("Document has no root element.")
         rootName, rootValue = items[0]
 
-        if self.nameSpaceMap:
-            map = self.nameSpaceMap
-        elif self.__explicitNamespaces:
-            map = self.__xmlNsMap.copy()
-            del map[None]
+        if nsmap:
+            map = nsmap
         else:
             map = self.__xmlNsMap
+
+        if self.__explicitNamespaces:
+            map = map.copy()
+            del map[None]
 
         gen = ElementGenerator(rootValue, rootName,
                 nsmap=map, schema=self.__schema)

From jslagle@rpath.com Fri Apr 17 16:17:52 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3HKHqU7018469
	for <xobj-commits@lists.rpath.com>; Fri, 17 Apr 2009 20:17:52 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3HKHpdI014079
	for <xobj-commits@lists.rpath.com>; Fri, 17 Apr 2009 16:17:51 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3HKHpYm015040
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 17 Apr 2009 16:17:51 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3HKHoSi000583
	for <xobj-commits@lists.rpath.com>; Fri, 17 Apr 2009 16:17:50 -0400
Received: (from jslagle@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3HKHo9O000577
	for xobj-commits@lists.rpath.com; Fri, 17 Apr 2009 16:17:50 -0400
From: James Slagle <jslagle@rpath.com>
Message-Id: <200904172017.n3HKHo9O000577@scc.eng.rpath.com>
Date: Fri, 17 Apr 2009 16:17:50 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Apply the namespace to the tag
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 17 Apr 2009 20:17:52 -0000

tag:         tip
user:        James Slagle <https://issues.rpath.com>
files:       py/xobj/xobj.py

Apply the namespace to the tag

diff -r 415cd41f1720 -r 7d1d139b7934 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Fri Apr 17 11:27:54 2009 -0400
+++ b/py/xobj/xobj.py	Fri Apr 17 16:17:46 2009 -0400
@@ -197,6 +197,7 @@
 
             if xobj._xobj.tag is not None:
                 tag = xobj._xobj.tag
+                tag = addns(tag)
         else:
             attrSet = set()
 

From bpja@rpath.com Mon Apr 20 02:23:36 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3K6NaWg029487
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 06:23:36 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3K6NaCL028484
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 02:23:36 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3K6NZP4018433
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 02:23:35 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3K6NYwf026089
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 02:23:34 -0400
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3K6NXDX026064
	for xobj-commits@lists.rpath.com; Mon, 20 Apr 2009 02:23:33 -0400
From: Brett Adam <bpja@rpath.com>
Message-Id: <200904200623.n3K6NXDX026064@scc.eng.rpath.com>
Date: Mon, 20 Apr 2009 02:23:33 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Fixes for decoding objects into existing instances with
	array reset
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 20 Apr 2009 06:23:36 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Fixes for decoding objects into existing instances with array reset

diff -r 7d1d139b7934 -r ee754f80d4a6 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Fri Apr 17 16:17:46 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Mon Apr 20 02:23:19 2009 -0400
@@ -13,14 +13,13 @@
 
 package com.rpath.xobj
 {
+    import flash.utils.getDefinitionByName;
+    import flash.utils.getQualifiedClassName;
+    import flash.xml.XMLNode;
+    
     import mx.collections.ArrayCollection;
     import mx.utils.DescribeTypeCache;
     import mx.utils.ObjectProxy;
-
-    import flash.utils.getQualifiedClassName;
-    import flash.utils.getDefinitionByName;
-    import flash.xml.XMLNode;
-    
     import mx.utils.object_proxy;
     use namespace object_proxy;
     
@@ -89,7 +88,19 @@
     
             return classReference;
          }    
-         
+
+        /**
+         * Return a Class instance based on a string class name
+         * @private
+          */
+        public static function classOf(obj:*):Class
+        {
+            var className:String = getQualifiedClassName(obj);
+            var classReference:Class = getClassByName(className);
+            
+            return classReference;
+         }    
+                  
         private static var typePropertyCache:Object = {};
     
         public static function isTypeArray(type:Class):Boolean
diff -r 7d1d139b7934 -r ee754f80d4a6 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Fri Apr 17 16:17:46 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon Apr 20 02:23:19 2009 -0400
@@ -429,12 +429,12 @@
                         propertyIsArray = true;
                     }
                     
-                    assign(result, partName, partObj, propertyIsArray, propertyIsArrayCollection, shouldMakeBindable);
+                    result = assign(result, partName, partObj, seenProperties[partName], propertyIsArray, propertyIsArrayCollection, shouldMakeBindable);
                     
                     // should we keep an extra, well-known ref to the object?
                     if (nextNodeIsRoot && !doneRootDupe)
                     {
-                        assign(result, "root", partObj, propertyIsArray, propertyIsArrayCollection, shouldMakeBindable);
+                        result = assign(result, "root", partObj, seenProperties[partName], propertyIsArray, propertyIsArrayCollection, shouldMakeBindable);
                         doneRootDupe = true;
                     }
                     
@@ -536,32 +536,117 @@
     import flash.utils.flash_proxy;
 
     private function assignToProperty(result:*, propName:String, value:*,
-        makeArray:Boolean, makeArrayCollection:Boolean, makeBindable:Boolean):void
+        seenBefore:Boolean, makeArray:Boolean, makeArrayCollection:Boolean, makeBindable:Boolean):*
     {
         if (result == null)
-            return;
+            return result;
         
+        if (propName == "file")
+            trace("file");
+            
         if (makeArray || makeArrayCollection)
         {
             var existing:* = result[propName];
             
             if (existing == null)
             {
-                existing = [];
-                existing = (existing as Array).concat(value);
+                if (makeArrayCollection)
+                {
+                    existing = new ArrayCollection([]);
+                    if (!(value is Array) && !(value is ArrayCollection))
+                    {
+                        (existing as ArrayCollection).addItem(value);
+                    }
+                    else
+                    {
+                        value = makeCollection(value);
+                        for each (var v:* in value)
+                        {
+                            (existing as ArrayCollection).addItem(v);
+                        }
+                    }
+                }
+                else
+                {
+                    existing = [];
+                    existing = (existing as Array).concat(value);
+                }
             }
             else if (existing is Array)
             {
+                if (!seenBefore)
+                {
+                    (existing as Array).splice(0, (existing as Array).length);
+                }
+                
                 existing = (existing as Array).concat(value);
             }
             else if (existing is ArrayCollection)
             {
-                existing = (existing as ArrayCollection).source.concat(value);
+                if (!seenBefore)
+                {
+                    (existing as ArrayCollection).removeAll();
+                }
+                
+                if (!(value is Array) && !(value is ArrayCollection))
+                {
+                    (existing as ArrayCollection).addItem(value);
+                }
+                else
+                {
+                    value = makeCollection(value);
+                    for each (var v1:* in value)
+                    {
+                        (existing as ArrayCollection).addItem(v1);
+                    }
+                }
             }
             else
             {
-                existing = [existing];
-                existing = (existing as Array).concat(value);
+                if (!seenBefore)
+                {
+                    // throw away old, (non decoded) value
+                    if (makeArrayCollection)
+                    {
+                        existing = new ArrayCollection([]);
+                    }
+                    else
+                    {
+                        existing = [];
+                    }
+                }
+                else
+                {
+                    // throw away old, (non decoded) value
+                    if (makeArrayCollection)
+                    {
+                        existing = new ArrayCollection([existing]);
+                    }
+                    else
+                    {
+                        existing = [existing];
+                    }
+                }
+
+                if (makeArrayCollection)
+                {
+                    if (!(value is Array) && !(value is ArrayCollection))
+                    {
+                        (existing as ArrayCollection).addItem(value);
+                    }
+                    else
+                    {
+                        value = makeCollection(value);
+                        for each (var v2:* in value)
+                        {
+                            (existing as ArrayCollection).addItem(v2);
+                        }
+                    }
+                }
+                else
+                {
+                    existing = (existing as Array).concat(value);
+                }
             }
             
             if ((makeArrayCollection || makeBindable) && !(existing is ArrayCollection))
@@ -571,18 +656,33 @@
         }
         
         result[propName] = value;
+        return result;
     }
     
     private function assignToArray(result:*, propName:String, value:*,
-        makeArray:Boolean, makeArrayCollection:Boolean, makeBindable:Boolean):void
+        seenBefore:Boolean, makeArray:Boolean, makeArrayCollection:Boolean, makeBindable:Boolean):*
     {
         if (result == null)
-            return;
+            return result;
+
+        if (result is Array)
+        {
+            if (!seenBefore)
+            {
+                (result as Array).splice(0, (result as Array).length);
+            }
+            result.push(value);
+        }
+        else if (result is ArrayCollection)
+        {
+            if (!seenBefore)
+            {
+                (result as ArrayCollection).removeAll();
+            }
+            result.addItem(value);
+        }
         
-        if (result is Array)
-            result.push(value);
-        else if (result is ArrayCollection)
-            result.addItem(value);
+        return result;
     }
     
 
@@ -676,7 +776,16 @@
         return {qname: qname, propname: name};
     }
     
-        
+    public function makeCollection(v:*):ArrayCollection
+    {
+        if (v is ArrayCollection)
+            return v;
+        else if (v is Array)
+            return new ArrayCollection(v);
+        else
+            return new ArrayCollection([v]);
+    }
+    
     private var makeObjectsBindable:Boolean;
     private var makeAttributesMeta:Boolean;
 }

From bpja@rpath.com Mon Apr 20 07:31:35 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3KBVZmJ030675
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 11:31:35 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3KBVY2t006475
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 07:31:34 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3KBVYcQ003153
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 07:31:34 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3KBVX3N002305
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 07:31:34 -0400
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3KBVXxt002300
	for xobj-commits@lists.rpath.com; Mon, 20 Apr 2009 07:31:33 -0400
From: Brett Adam <bpja@rpath.com>
Message-Id: <200904201131.n3KBVXxt002300@scc.eng.rpath.com>
Date: Mon, 20 Apr 2009 07:31:33 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: remove trace
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 20 Apr 2009 11:31:35 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

remove trace

diff -r ee754f80d4a6 -r d2c82f37ed21 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon Apr 20 02:23:19 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon Apr 20 07:31:23 2009 -0400
@@ -541,9 +541,6 @@
         if (result == null)
             return result;
         
-        if (propName == "file")
-            trace("file");
-            
         if (makeArray || makeArrayCollection)
         {
             var existing:* = result[propName];

From dbc@rpath.com Mon Apr 20 17:50:47 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3KLolIR000358
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 21:50:47 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3KLolSp029824
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 17:50:47 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3KLolLf016605
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 17:50:47 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3KLokC5026056
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 17:50:46 -0400
Received: (from dbc@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3KLoj1x026050
	for xobj-commits@lists.rpath.com; Mon, 20 Apr 2009 17:50:45 -0400
From: David Christian <dbc@rpath.com>
Message-Id: <200904202150.n3KLoj1x026050@scc.eng.rpath.com>
Date: Mon, 20 Apr 2009 17:50:45 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Set lists to None as well to allow for distinguishing
	between empty lists and
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 20 Apr 2009 21:50:48 -0000

tag:         tip
user:        David Christian <http://issues.rpath.com>
files:       py/xobj/xobj.py

Set lists to None as well to allow for distinguishing between empty lists and
unspecified lists.

diff -r d2c82f37ed21 -r 56bc95247417 py/xobj/xobj.py
--- a/py/xobj/xobj.py	Mon Apr 20 07:31:23 2009 -0400
+++ b/py/xobj/xobj.py	Mon Apr 20 17:50:42 2009 -0400
@@ -510,13 +510,13 @@
 
             # anything which is the same as in the class wasn't set in XML, so
             # set it to None
+            # We even set lists to None as it is important to be
+            # able to distinguish between not specifying a list and
+            # specifying the empty list.
             for key, val in xobj.__class__.__dict__.items():
                 if key[0] == '_': continue
                 if getattr(xobj, key) == val:
-                    if type(val) == list:
-                        setattr(xobj, key, [])
-                    else:
-                        setattr(xobj, key, None)
+                    setattr(xobj, key, None)
 
             if parentXObj is not None:
                 if tag in parentUnionTags:

From dbc@rpath.com Mon Apr 20 18:24:47 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3KMOlY3000471
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 22:24:47 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3KMOlnE030870
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 18:24:47 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3KMOktK018560
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 18:24:46 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3KMOjaU027362
	for <xobj-commits@lists.rpath.com>; Mon, 20 Apr 2009 18:24:45 -0400
Received: (from dbc@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3KMOi8g027357
	for xobj-commits@lists.rpath.com; Mon, 20 Apr 2009 18:24:44 -0400
From: David Christian <dbc@rpath.com>
Message-Id: <200904202224.n3KMOi8g027357@scc.eng.rpath.com>
Date: Mon, 20 Apr 2009 18:24:44 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Fix tests
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 20 Apr 2009 22:24:47 -0000

tag:         tip
user:        David Christian <http://issues.rpath.com>
files:       py/test/xobjtest.py

Fix tests

diff -r 56bc95247417 -r bd69e8d97973 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Mon Apr 20 17:50:42 2009 -0400
+++ b/py/test/xobjtest.py	Mon Apr 20 18:24:41 2009 -0400
@@ -503,7 +503,7 @@
             l = [ int ]
 
         d = xobj.parse("<top/>", typeMap = { 'top' : Top })
-        assert(d.top.l == [])
+        assert(d.top.l == None)
 
     def testUnion(self):
         class TypeA(xobj.XObj):
@@ -534,7 +534,7 @@
         assert(s == d.toxml(xml_declaration = False))
 
         d = xobj.parse('<top/>', typeMap = { 'top' : Top } )
-        assert(d.top.items == [])
+        assert(d.top.items == None)
 
     def testObjectTree(self):
         class Top(object):

From bpja@rpath.com Tue Apr 21 01:25:13 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3L5PDt7001909
	for <xobj-commits@lists.rpath.com>; Tue, 21 Apr 2009 05:25:13 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3L5PDJG010688
	for <xobj-commits@lists.rpath.com>; Tue, 21 Apr 2009 01:25:13 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3L5PCq5009081
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 21 Apr 2009 01:25:13 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3L5PCxu009924
	for <xobj-commits@lists.rpath.com>; Tue, 21 Apr 2009 01:25:12 -0400
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3L5PCa5009918
	for xobj-commits@lists.rpath.com; Tue, 21 Apr 2009 01:25:12 -0400
From: Brett Adam <bpja@rpath.com>
Message-Id: <200904210525.n3L5PCa5009918@scc.eng.rpath.com>
Date: Tue, 21 Apr 2009 01:25:12 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Fixed bug in decode into existing object
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 21 Apr 2009 05:25:13 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as

Fixed bug in decode into existing object

diff -r bd69e8d97973 -r 4b30dc40d93a as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as	Mon Apr 20 18:24:41 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as	Tue Apr 21 01:25:08 2009 -0400
@@ -26,7 +26,7 @@
 
         public function decodeXMLIntoObject(rootObject:*):Object
         {
-            return decoder.actualDecodeXML(dataNode, null, rootObject);
+            return decoder.actualDecodeXML(dataNode, null, rootObject, true);
         }
         
     }

From bmurphy@rpath.com Wed Apr 22 16:47:23 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3MKlNBM009497
	for <xobj-commits@lists.rpath.com>; Wed, 22 Apr 2009 20:47:23 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3MKlNDv020661
	for <xobj-commits@lists.rpath.com>; Wed, 22 Apr 2009 16:47:23 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3MKlMWY026169
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 22 Apr 2009 16:47:22 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3MKlMp8009355
	for <xobj-commits@lists.rpath.com>; Wed, 22 Apr 2009 16:47:22 -0400
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3MKlL6t009349
	for xobj-commits@lists.rpath.com; Wed, 22 Apr 2009 16:47:21 -0400
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200904222047.n3MKlL6t009349@scc.eng.rpath.com>
Date: Wed, 22 Apr 2009 16:47:21 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Added tag 5.1.0 for changeset 4b30dc40d93a
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 22 Apr 2009 20:47:23 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       .hgtags

Added tag 5.1.0 for changeset 4b30dc40d93a

diff -r 4b30dc40d93a -r 6cd99005a2d2 .hgtags
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgtags	Wed Apr 22 16:47:08 2009 -0400
@@ -0,0 +1,1 @@
+4b30dc40d93a17702815de04ad6e4f7015db4f76 5.1.0

From bpja@rpath.com Thu Apr 23 20:23:24 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3O0NNtF014622
	for <xobj-commits@lists.rpath.com>; Fri, 24 Apr 2009 00:23:23 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3O0NNA0008202
	for <xobj-commits@lists.rpath.com>; Thu, 23 Apr 2009 20:23:23 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3O0NNZk027416
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 23 Apr 2009 20:23:23 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.13.7/8.13.7) with ESMTP id n3O0NMH1023289
	for <xobj-commits@lists.rpath.com>; Thu, 23 Apr 2009 20:23:22 -0400
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.13.7/8.13.7/Submit) id n3O0NMbW023284
	for xobj-commits@lists.rpath.com; Thu, 23 Apr 2009 20:23:22 -0400
From: Brett Adam <bpja@rpath.com>
Message-Id: <200904240023.n3O0NMbW023284@scc.eng.rpath.com>
Date: Thu, 23 Apr 2009 20:23:22 -0400
To: xobj-commits@lists.rpath.com
Subject: xobj: Undo change to GET in place. Was causing trouble for Images and
	Releases. Under investigation
User-Agent: nail 11.22 3/20/05
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 24 Apr 2009 00:23:24 -0000

tag:         tip
user:        Brett Adam bpja@rpath.com
files:       as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as

Undo change to GET in place. Was causing trouble for Images and Releases. Under investigation

diff -r 6cd99005a2d2 -r d19176ffd3f6 as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as	Wed Apr 22 16:47:08 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as	Thu Apr 23 20:22:53 2009 -0400
@@ -26,7 +26,7 @@
 
         public function decodeXMLIntoObject(rootObject:*):Object
         {
-            return decoder.actualDecodeXML(dataNode, null, rootObject, true);
+            return decoder.actualDecodeXML(dataNode, null, rootObject, false);
         }
         
     }

From bmurphy@rpath.com Wed Apr 29 16:52:35 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n3TKqYVi008518
	for <xobj-commits@lists.rpath.com>; Wed, 29 Apr 2009 20:52:34 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n3TKqYMY020701
	for <xobj-commits@lists.rpath.com>; Wed, 29 Apr 2009 16:52:34 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n3TKqYvX020786
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 29 Apr 2009 16:52:34 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n3TKqXYX015481
	for <xobj-commits@lists.rpath.com>; Wed, 29 Apr 2009 20:52:33 GMT
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n3TKqWIo015477
	for xobj-commits@lists.rpath.com; Wed, 29 Apr 2009 20:52:32 GMT
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200904292052.n3TKqWIo015477@scc.eng.rpath.com>
Date: Wed, 29 Apr 2009 20:52:32 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Added tag rbo_04292009 for changeset d19176ffd3f6
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 29 Apr 2009 20:52:35 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       .hgtags

Added tag rbo_04292009 for changeset d19176ffd3f6

diff -r d19176ffd3f6 -r 3a485932d55f .hgtags
--- a/.hgtags	Thu Apr 23 20:22:53 2009 -0400
+++ b/.hgtags	Wed Apr 29 16:52:17 2009 -0400
@@ -1,1 +1,2 @@
 4b30dc40d93a17702815de04ad6e4f7015db4f76 5.1.0
+d19176ffd3f6141309af712a49793832aee43125 rbo_04292009

From johnsonm@rpath.com Fri May  1 16:58:23 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n41KwN3Z018707
	for <xobj-commits@lists.rpath.com>; Fri, 1 May 2009 20:58:23 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n41KwNQu018105
	for <xobj-commits@lists.rpath.com>; Fri, 1 May 2009 16:58:23 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n41KwMEe031362
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 1 May 2009 16:58:22 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n41KwMkZ025815
	for <xobj-commits@lists.rpath.com>; Fri, 1 May 2009 20:58:22 GMT
Received: (from johnsonm@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n41KwMD1025811
	for xobj-commits@lists.rpath.com; Fri, 1 May 2009 20:58:22 GMT
From: "Michael K. Johnson" <johnsonm@rpath.com>
Message-Id: <200905012058.n41KwMD1025811@scc.eng.rpath.com>
Date: Fri, 01 May 2009 20:58:22 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: prepare for release
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 01 May 2009 20:58:23 -0000

tag:         tip
user:        Michael K. Johnson <http://issues.rpath.com/>
files:       Make.defs Makefile NEWS README

prepare for release

diff -r 3a485932d55f -r 1fe52a043ead Make.defs
--- a/Make.defs	Wed Apr 29 16:52:17 2009 -0400
+++ b/Make.defs	Fri May 01 16:58:17 2009 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2008-2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
@@ -9,6 +9,8 @@
 # without any waranty; without even the implied warranty of merchantability
 # or fitness for a particular purpose. See the MIT License for full details.
 #
+
+VERSION=0.1
 
 export prefix = /usr
 export lib = $(shell arch | sed -r '/x86_64|ppc64|s390x|sparc64/{s/.*/lib64/;q};s/.*/lib/')
diff -r 3a485932d55f -r 1fe52a043ead Makefile
--- a/Makefile	Wed Apr 29 16:52:17 2009 -0400
+++ b/Makefile	Fri May 01 16:58:17 2009 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2008-2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
@@ -21,11 +21,21 @@
 
 test: default-test
 
+forcetag:
+	hg tag -f xobj-$(VERSION)
+
+tag:
+	hg tag xobj-$(VERSION)
+
+
 
 dist: archive
 
+archive-snapshot:
+	hg archive --exclude .hgignore -t tbz2 xobj-$$(hg id -i).tar.bz2
+
 archive:
-	hg archive --exclude .hgignore -t tbz2 xobj-`hg id -i`.tar.bz2
+	hg archive --exclude .hgignore -t tbz2 xobj-$(VERSION).tar.bz2
 
 
 export TOPDIR=$(shell pwd)
diff -r 3a485932d55f -r 1fe52a043ead NEWS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NEWS	Fri May 01 16:58:17 2009 -0400
@@ -0,0 +1,2 @@
+Changes in @NEW@:
+  o Initial public release.
diff -r 3a485932d55f -r 1fe52a043ead README
--- a/README	Wed Apr 29 16:52:17 2009 -0400
+++ b/README	Fri May 01 16:58:17 2009 -0400
@@ -1,7 +1,7 @@
 INTRODUCTION
 ============
 
-The xobj project provides an object reflector between various
+The xobj project provides object reflector interfaces between various
 dynamic languages and XML.  Currently, Python and ActionScript 3
 implementations are available.
 
@@ -9,7 +9,7 @@
 and manipulating XML documents.  For example, using the ElementTree
 Python library, you might write something like this:
 
-    imageItem = [ x for x in parent if x.tag='image' ]
+    imageItem = [ x for x in parent if x.tag == 'image' ]
 
 In this case, imageItem will always be a list, even if it is
 not defined in the XML schema to be a sequence.

From bmurphy@rpath.com Tue May  5 12:52:13 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n45GqDUG003154
	for <xobj-commits@lists.rpath.com>; Tue, 5 May 2009 16:52:13 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n45GqC3H021880
	for <xobj-commits@lists.rpath.com>; Tue, 5 May 2009 12:52:12 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n45GqCJi014958
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 5 May 2009 12:52:12 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n45GqBAP020621
	for <xobj-commits@lists.rpath.com>; Tue, 5 May 2009 16:52:11 GMT
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n45Gq9XD020607
	for xobj-commits@lists.rpath.com; Tue, 5 May 2009 16:52:09 GMT
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200905051652.n45Gq9XD020607@scc.eng.rpath.com>
Date: Tue, 05 May 2009 16:52:09 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Added tag rba_5.1.2 for changeset 3a485932d55f
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 05 May 2009 16:52:13 -0000

user:        Brad Murphy <https://issues.rpath.com>
files:       .hgtags

Added tag rba_5.1.2 for changeset 3a485932d55f

diff -r 3a485932d55f -r bad4f5fce190 .hgtags
--- a/.hgtags	Wed Apr 29 16:52:17 2009 -0400
+++ b/.hgtags	Fri May 01 19:34:27 2009 -0400
@@ -1,2 +1,3 @@
 4b30dc40d93a17702815de04ad6e4f7015db4f76 5.1.0
 d19176ffd3f6141309af712a49793832aee43125 rbo_04292009
+3a485932d55fe293fc33ccdae3824981179977a8 rba_5.1.2

From bpja@rpath.com Fri May 15 00:04:35 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n4F44ZVa014515
	for <xobj-commits@lists.rpath.com>; Fri, 15 May 2009 04:04:35 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n4F44Za0030867
	for <xobj-commits@lists.rpath.com>; Fri, 15 May 2009 00:04:35 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n4F44ZfJ025047
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 15 May 2009 00:04:35 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n4F44Xwa004828
	for <xobj-commits@lists.rpath.com>; Fri, 15 May 2009 04:04:33 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n4F44X86004813
	for xobj-commits@lists.rpath.com; Fri, 15 May 2009 04:04:33 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200905150404.n4F44X86004813@scc.eng.rpath.com>
Date: Fri, 15 May 2009 04:04:33 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Superclass helper function
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 15 May 2009 04:04:36 -0000

user:        Brett Adam
files:       as3/xobjas3/src/com/rpath/xobj/XObjUtils.as

Superclass helper function

diff -r d19176ffd3f6 -r 1ac04db6d609 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Thu Apr 23 20:22:53 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Thu May 14 23:57:21 2009 -0400
@@ -191,7 +191,7 @@
         /**
          * Use our own version of getClassInfo to support various metadata
          * tags we use.  See ObjectUtil.getClassInfo for more info about
-         * the baisc functionality of this method.
+         * the basic functionality of this method.
          */  
         public static function getClassInfo(obj:Object,
                                             excludes:Array = null,
@@ -422,6 +422,19 @@
             return result;
         }
         
+        public static function getSuperclasses(object:*):Array
+        {
+            var result:Array = [];
+            var classInfo:XML = DescribeTypeCache.describeType(object).typeDescription;
+            
+            for each (var superClass:XML in classInfo.extendsClass)
+            {
+                result.push(getClassByName(superClass.@type));
+            }
+            return result;
+        }
+        
+            
         /**
          *  @private
          */

From bpja@rpath.com Mon May 18 12:36:33 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n4IGaX4A030763
	for <xobj-commits@lists.rpath.com>; Mon, 18 May 2009 16:36:33 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n4IGaXNm021739
	for <xobj-commits@lists.rpath.com>; Mon, 18 May 2009 12:36:33 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n4IGaXqo023378
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 18 May 2009 12:36:33 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n4IGaWlQ013474
	for <xobj-commits@lists.rpath.com>; Mon, 18 May 2009 16:36:32 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n4IGaV8r013470
	for xobj-commits@lists.rpath.com; Mon, 18 May 2009 16:36:31 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200905181636.n4IGaV8r013470@scc.eng.rpath.com>
Date: Mon, 18 May 2009 16:36:31 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Fix for handling of large numbers in AS3 simpleType
	decoding. They were incorrectly marked as Infinity when presented in
	scientific notation. Adobe bug
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 18 May 2009 16:36:33 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Fix for handling of large numbers in AS3 simpleType decoding. They were incorrectly marked as Infinity when presented in scientific notation. Adobe bug

diff -r 5ebb3f422104 -r 3b3182948806 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Fri May 15 00:04:26 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon May 18 12:36:27 2009 -0400
@@ -128,25 +128,31 @@
 
         if (val != null)
         {
+            var testNum:Number = Number(val);
+            var valStr:String = val.toString();
+            var lowerVal:String  = val.toString().toLowerCase();
+            
             //return the value as a string, a boolean or a number.
             //numbers that start with 0 are left as strings
             //bForceObject removed since we'll take care of converting to a String or Number object later
             if (val is String && String(val) == "")
             {
-                result = val.toString();    
+                result = valStr;    
             }
-            else if (isNaN(Number(val)) || (val.charAt(0) == '0') || ((val.charAt(0) == '-') && (val.charAt(1) == '0')) || val.charAt(val.length -1) == 'E')
+            else if (lowerVal == "true")
             {
-                var valStr:String = val.toString();
-
-                //Bug 101205: Also check for boolean
-                var valStrLC:String = valStr.toLowerCase();
-                if (valStrLC == "true")
-                    result = true;
-                else if (valStrLC == "false")
-                    result = false;
-                else
-                    result = valStr;
+                result = true;
+            }
+            else if (lowerVal == "false")
+            {
+                result = false;
+            }
+            else if (!isFinite(testNum) || isNaN(testNum)
+                || (val.charAt(0) == '0') // starts with a leading zero
+                || ((val.charAt(0) == '-') && (val.charAt(1) == '0')) // starts with -0
+                || lowerVal.charAt(lowerVal.length -1) == 'e') // TODO: wtf?
+            {
+                result = valStr;
             }
             else
             {

From bmurphy@rpath.com Tue May 19 16:33:54 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n4JKXsHY003802
	for <xobj-commits@lists.rpath.com>; Tue, 19 May 2009 20:33:54 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n4JKXsgk017283
	for <xobj-commits@lists.rpath.com>; Tue, 19 May 2009 16:33:54 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n4JKXrwo024861
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 19 May 2009 16:33:53 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n4JKXq0W019166
	for <xobj-commits@lists.rpath.com>; Tue, 19 May 2009 20:33:52 GMT
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n4JKXqw2019162
	for xobj-commits@lists.rpath.com; Tue, 19 May 2009 20:33:52 GMT
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200905192033.n4JKXqw2019162@scc.eng.rpath.com>
Date: Tue, 19 May 2009 20:33:52 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Added tag rba_5.1.3 for changeset 3b3182948806
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 19 May 2009 20:33:54 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       .hgtags

Added tag rba_5.1.3 for changeset 3b3182948806

diff -r 3b3182948806 -r fbd9b637c188 .hgtags
--- a/.hgtags	Mon May 18 12:36:27 2009 -0400
+++ b/.hgtags	Tue May 19 16:33:47 2009 -0400
@@ -1,3 +1,4 @@
 4b30dc40d93a17702815de04ad6e4f7015db4f76 5.1.0
 d19176ffd3f6141309af712a49793832aee43125 rbo_04292009
 3a485932d55fe293fc33ccdae3824981179977a8 rba_5.1.2
+3b318294880639e654575df816b59c1f13ac4425 rba_5.1.3

From bpja@rpath.com Thu May 21 11:53:27 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n4LFrR7p011615
	for <xobj-commits@lists.rpath.com>; Thu, 21 May 2009 15:53:27 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n4LFrRvu001421
	for <xobj-commits@lists.rpath.com>; Thu, 21 May 2009 11:53:27 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n4LFrRs6017824
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 21 May 2009 11:53:27 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n4LFrQAa011884
	for <xobj-commits@lists.rpath.com>; Thu, 21 May 2009 15:53:26 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n4LFrQSD011880
	for xobj-commits@lists.rpath.com; Thu, 21 May 2009 15:53:26 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200905211553.n4LFrQSD011880@scc.eng.rpath.com>
Date: Thu, 21 May 2009 15:53:26 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: getClassHierarchy
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 21 May 2009 15:53:28 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3/src/com/rpath/xobj/XObjUtils.as

getClassHierarchy

diff -r fbd9b637c188 -r df79d728d530 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Tue May 19 16:33:47 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Thu May 21 11:53:22 2009 -0400
@@ -422,6 +422,14 @@
             return result;
         }
         
+        public static function getClassHeirarchy(object:*):Array
+        {
+            var result:Array = getSuperclasses(object);
+            
+            result.splice(0,0, classOf(object));
+            return result;
+        }
+        
         public static function getSuperclasses(object:*):Array
         {
             var result:Array = [];

From bpja@rpath.com Wed May 27 00:00:22 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n4R40MOn003955
	for <xobj-commits@lists.rpath.com>; Wed, 27 May 2009 04:00:22 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n4R40M7i024200
	for <xobj-commits@lists.rpath.com>; Wed, 27 May 2009 00:00:22 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n4R40LXF002676
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 27 May 2009 00:00:21 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n4R40K7p012757
	for <xobj-commits@lists.rpath.com>; Wed, 27 May 2009 04:00:20 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n4R40K4d012753
	for xobj-commits@lists.rpath.com; Wed, 27 May 2009 04:00:20 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200905270400.n4R40K4d012753@scc.eng.rpath.com>
Date: Wed, 27 May 2009 04:00:20 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Improved handling of multiple entries in the
	describeTypeCache for an overridden accessor. Introduced cache for
	isArray and isArrayCollection lookups
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 27 May 2009 04:00:22 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3/.actionScriptProperties as3/xobjas3/.flexLibProperties as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Improved handling of multiple entries in the describeTypeCache for an overridden accessor. Introduced cache for isArray and isArrayCollection lookups

diff -r df79d728d530 -r feadea5a99f8 as3/xobjas3/.actionScriptProperties
--- a/as3/xobjas3/.actionScriptProperties	Thu May 21 11:53:22 2009 -0400
+++ b/as3/xobjas3/.actionScriptProperties	Wed May 27 00:00:08 2009 -0400
@@ -3,7 +3,16 @@
 <compiler additionalCompilerArguments="-keep-as3-metadata+=ArrayElementType,xobjTransient -dump-config=/tmp/foo.xml" copyDependentFiles="false" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
 <compilerSourcePath/>
 <libraryPath defaultLinkType="1">
-<libraryPathEntry kind="4" path=""/>
+<libraryPathEntry kind="4" path="">
+<modifiedEntries>
+<libraryPathEntry kind="3" linkType="4" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="true">
+<crossDomainRsls>
+<crossDomainRslEntry autoExtract="true" policyFileUrl="" rslUrl="framework_3.2.0.3958.swz"/>
+<crossDomainRslEntry autoExtract="true" policyFileUrl="" rslUrl="framework_3.2.0.3958.swf"/>
+</crossDomainRsls>
+</libraryPathEntry>
+</modifiedEntries>
+</libraryPathEntry>
 </libraryPath>
 <sourceAttachmentPath/>
 </compiler>
diff -r df79d728d530 -r feadea5a99f8 as3/xobjas3/.flexLibProperties
--- a/as3/xobjas3/.flexLibProperties	Thu May 21 11:53:22 2009 -0400
+++ b/as3/xobjas3/.flexLibProperties	Wed May 27 00:00:08 2009 -0400
@@ -4,13 +4,14 @@
 <classEntry path="com.rpath.xobj.XObjUtils"/>
 <classEntry path="com.rpath.xobj.XObjXMLEncoder"/>
 <classEntry path="com.rpath.xobj.XObjDeferredDecode"/>
+<classEntry path="com.rpath.xobj.XObjTypeInfo"/>
 <classEntry path="com.rpath.xobj.XObjString"/>
 <classEntry path="com.rpath.xobj.SchemaAwareXMLDecoder"/>
 <classEntry path="com.rpath.xobj.XObjVersion"/>
 <classEntry path="com.rpath.xobj.XObjQName"/>
 <classEntry path="com.rpath.xobj.XObjMetadata"/>
+<classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
 <classEntry path="com.rpath.xobj.XObjXMLDecoder"/>
-<classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
 </includeClasses>
 <includeResources/>
 <namespaceManifests/>
diff -r df79d728d530 -r feadea5a99f8 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Thu May 21 11:53:22 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Wed May 27 00:00:08 2009 -0400
@@ -13,6 +13,7 @@
 
 package com.rpath.xobj
 {
+    import flash.utils.Dictionary;
     import flash.utils.getDefinitionByName;
     import flash.utils.getQualifiedClassName;
     import flash.xml.XMLNode;
@@ -101,33 +102,66 @@
             return classReference;
          }    
                   
-        private static var typePropertyCache:Object = {};
+        private static var typePropertyCache:Dictionary = new Dictionary(true);
     
-        public static function isTypeArray(type:Class):Boolean
+        private static var arrayTypeCache:Dictionary = new Dictionary(true);
+        private static var arrayCollectionTypeCache:Dictionary = new Dictionary(true);
+        
+        public static function isTypeArray(type:*):Boolean
         {
-            if (type == null)
+            var result:Boolean;
+            
+            if (type == null || type == "")
                 return false;
             
-            var foo:* = new type();
-            return (foo is Array);
+            if (type is String)
+                type = getClassByName(type);
+            
+            result = arrayTypeCache[type];
+            if (arrayTypeCache[type] == undefined)
+            {
+                // TODO: better way to detect an arry subclass?
+                var foo:* = new type();
+                result = (foo is Array);
+                arrayTypeCache[type] = result;
+
+                // do the array collection test while we're here, to save time
+                arrayCollectionTypeCache[type] = (foo is ArrayCollection);
+            }
+            return result;
         }
     
-        public static function isTypeArrayCollection(type:Class):Boolean
+        public static function isTypeArrayCollection(type:*):Boolean
         {
-            if (type == null)
+            var result:Boolean;
+
+            if (type == null || type == "")
                 return false;
+
+            if (type is String)
+                type = getClassByName(type);
     
-            var foo:* = new type();
-            return (foo is ArrayCollection);
+            result = arrayCollectionTypeCache[type];
+            if (arrayCollectionTypeCache[type] == undefined)
+            {
+                // TODO: better way to detect an arry subclass?
+                var foo:* = new type();
+                result = (foo is ArrayCollection);
+                arrayCollectionTypeCache[type] = result;
+
+                // do the array test while we're here, to save time
+                arrayTypeCache[type] = (foo is Array);
+            }
+            return result;
         }
         
-        public static function typeInfoForProperty(object:*, className:String, propName:String):Object
+        public static function typeInfoForProperty(object:*, className:String, propName:String):XObjTypeInfo
         {
             var isArray:Boolean = false;
-            var result:Object = {typeName: null, isArray: false, isArrayCollection: false};
+            var result:XObjTypeInfo;
 
             if (className == "Object" || className == "mx.utils::ObjectProxy")
-                return result;
+                return new XObjTypeInfo();
             
             var propertyCacheKey:String = className + "." + propName;
             var arrayElementType:String;
@@ -136,7 +170,7 @@
                 
             if (result == null)
             {
-                result = {typeName: null, isArray: false, isArrayCollection: false};
+                result = new XObjTypeInfo();
                 
                 // go look it up (expensive)
                 // very important to use the instance object here, not the classname
@@ -145,7 +179,11 @@
                 var typeDesc:* = DescribeTypeCache.describeType(object);
                 var typeInfo:XML = typeDesc.typeDescription;
                 
-                result.typeName = typeInfo..accessor.(@name == propName).@type.toString().replace( /::/, "." );
+                var accessorList:XMLList = typeInfo..accessor.(@name == propName);
+                
+                if (accessorList.length() > 0)
+                    result.typeName = accessorList[0].@type.toString().replace( /::/, "." );
+                
                 if (result.typeName == null || result.typeName == "")
                 {    
                     result.typeName = typeInfo..variable.(@name == propName).@type.toString().replace( /::/, "." );
@@ -154,14 +192,10 @@
                 else
                     arrayElementType = typeInfo..accessor.(@name == propName).metadata.(@name == 'ArrayElementType').arg.@value.toString().replace( /::/, "." );
                 
-                if (result.typeName == "Array")
+                result.isArray = isTypeArray(result.typeName);
+                result.isArrayCollection = isTypeArrayCollection(result.typeName);
+                if (result.isArray || result.isArrayCollection)
                 {
-                    result.isArray = true;
-                    result.typeName = null; // assume generic object unless told otherwise
-                }
-                else if (result.typeName == "mx.collections.ArrayCollection")
-                {
-                    result.isArrayCollection = true;
                     result.typeName = null; // assume generic object unless told otherwise
                 }
                 
diff -r df79d728d530 -r feadea5a99f8 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Thu May 21 11:53:22 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Wed May 27 00:00:08 2009 -0400
@@ -411,7 +411,7 @@
                     lastPartName.propname = partName;
 
                     // what type do we want?
-                    var typeInfo:Object = XObjUtils.typeInfoForProperty(result, resultTypeName, partName);
+                    var typeInfo:XObjTypeInfo = XObjUtils.typeInfoForProperty(result, resultTypeName, partName);
                     var partTypeName:String = typeInfo.typeName;
                     var propertyIsArray:Boolean = typeInfo.isArray;
                     var propertyIsArrayCollection:Boolean = typeInfo.isArrayCollection;

From bpja@rpath.com Wed May 27 00:00:49 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n4R40nq9003961
	for <xobj-commits@lists.rpath.com>; Wed, 27 May 2009 04:00:49 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n4R40ns8024215
	for <xobj-commits@lists.rpath.com>; Wed, 27 May 2009 00:00:49 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n4R40mrs002685
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 27 May 2009 00:00:49 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n4R40mXX012836
	for <xobj-commits@lists.rpath.com>; Wed, 27 May 2009 04:00:48 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n4R40lEn012832
	for xobj-commits@lists.rpath.com; Wed, 27 May 2009 04:00:47 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200905270400.n4R40lEn012832@scc.eng.rpath.com>
Date: Wed, 27 May 2009 04:00:47 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Missing XObjTypeInfo class from last commit
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 27 May 2009 04:00:49 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as

Missing XObjTypeInfo class from last commit

diff -r feadea5a99f8 -r 341e33d48f21 as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as	Wed May 27 00:00:30 2009 -0400
@@ -0,0 +1,15 @@
+package com.rpath.xobj
+{
+    public class XObjTypeInfo
+    {
+        public function XObjTypeInfo()
+        {
+        }
+
+        public var type:Class;
+        public var typeName:String;
+        public var isArray:Boolean;
+        public var isArrayCollection:Boolean;
+        
+    }
+}
\ No newline at end of file

From bpja@rpath.com Fri Jun  5 11:49:45 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n55Fnii2016151
	for <xobj-commits@lists.rpath.com>; Fri, 5 Jun 2009 15:49:45 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n55FninO006776
	for <xobj-commits@lists.rpath.com>; Fri, 5 Jun 2009 11:49:44 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n55FniZm020846
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 5 Jun 2009 11:49:44 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n55FnigF020227
	for <xobj-commits@lists.rpath.com>; Fri, 5 Jun 2009 15:49:44 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n55Fnim1020223
	for xobj-commits@lists.rpath.com; Fri, 5 Jun 2009 15:49:44 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200906051549.n55Fnim1020223@scc.eng.rpath.com>
Date: Fri, 05 Jun 2009 15:49:43 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Set the _xobj metadata property to be non-enumerable so
	that it does not contaminate for each (in) constructs
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 05 Jun 2009 15:49:45 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as

Set the _xobj metadata property to be non-enumerable so that it does not contaminate for each (in) constructs

diff -r 341e33d48f21 -r 8b5ee20ba0f2 as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as	Wed May 27 00:00:30 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as	Fri Jun 05 11:49:39 2009 -0400
@@ -48,6 +48,7 @@
                try
                {
                    target[METADATA_PROPERTY] = new XObjMetadata();
+                   target.setPropertyIsEnumerable(METADATA_PROPERTY, false);
                    result = target[METADATA_PROPERTY];
                }
                catch (e:Error)

From bpja@rpath.com Mon Jun  8 15:05:53 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n58J5rrB029792
	for <xobj-commits@lists.rpath.com>; Mon, 8 Jun 2009 19:05:53 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n58J5rpm021276
	for <xobj-commits@lists.rpath.com>; Mon, 8 Jun 2009 15:05:53 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n58J5ra7029978
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 8 Jun 2009 15:05:53 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n58J5pQD016079
	for <xobj-commits@lists.rpath.com>; Mon, 8 Jun 2009 19:05:51 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n58J5oJ7016075
	for xobj-commits@lists.rpath.com; Mon, 8 Jun 2009 19:05:50 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200906081905.n58J5oJ7016075@scc.eng.rpath.com>
Date: Mon, 08 Jun 2009 19:05:50 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Added support for deep GET refresh into existing objects
	when retrieving from the wire,
	not just top level root object GET refresh. In support of RBL-4765
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 08 Jun 2009 19:05:54 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Added support for deep GET refresh into existing objects when retrieving from the wire, not just top level root object GET refresh. In support of RBL-4765

diff -r 8b5ee20ba0f2 -r 333659592392 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Fri Jun 05 11:49:39 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Mon Jun 08 15:05:46 2009 -0400
@@ -100,7 +100,13 @@
             var classReference:Class = getClassByName(className);
             
             return classReference;
-         }    
+         }
+         
+         public static function getClass(obj:*):Class
+         {
+             return classOf(obj);
+         }
+         
                   
         private static var typePropertyCache:Dictionary = new Dictionary(true);
     
diff -r 8b5ee20ba0f2 -r 333659592392 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Fri Jun 05 11:49:39 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon Jun 08 15:05:46 2009 -0400
@@ -327,7 +327,7 @@
         }
         
         // OK, so now we know what type we want
-        if (rootObject && isRootNode)
+        if (rootObject && !nextNodeIsRoot)
         {
             result = rootObject;
         }
@@ -421,6 +421,27 @@
                     {
                         var partClass:Class = XObjUtils.getClassByName(partTypeName);
                         
+                        // now, should we decode into a new object, or decode into an existing instance?
+                        if (!nextNodeIsRoot && result.hasOwnProperty(partName))
+                        {
+                            var existing:* = result[partName];
+                            if (existing && (existing is Object)
+                                && !((existing is Array) 
+                                    || (existing is ArrayCollection)
+                                    || (existing is String)
+                                    || (existing is Boolean)
+                                    )
+                                )
+                            {
+                                // reuse it
+                                rootObject = existing;
+                            }
+                            else
+                            {
+                                rootObject = null;
+                            }
+                        }
+                            
                         if (partClass)
                             partObj = actualDecodeXML(partNode, partClass, rootObject, nextNodeIsRoot);
                         else
@@ -657,8 +678,9 @@
                 
             value = existing;
         }
-        
+
         result[propName] = value;
+
         return result;
     }
     

From bpja@rpath.com Tue Jun  9 13:39:30 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n59HdUDD001486
	for <xobj-commits@lists.rpath.com>; Tue, 9 Jun 2009 17:39:30 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n59HdUCo029060
	for <xobj-commits@lists.rpath.com>; Tue, 9 Jun 2009 13:39:30 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n59HdUSw010702
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 9 Jun 2009 13:39:30 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n59HdSqU014745
	for <xobj-commits@lists.rpath.com>; Tue, 9 Jun 2009 17:39:28 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n59HdRWL014741
	for xobj-commits@lists.rpath.com; Tue, 9 Jun 2009 17:39:27 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200906091739.n59HdRWL014741@scc.eng.rpath.com>
Date: Tue, 09 Jun 2009 17:39:27 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: More fixes related to object refresh use cases. Related to
	RBL-4780
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 09 Jun 2009 17:39:30 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

More fixes related to object refresh use cases. Related to RBL-4780

diff -r 333659592392 -r 8483b2203435 as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as	Mon Jun 08 15:05:46 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as	Tue Jun 09 13:39:22 2009 -0400
@@ -48,7 +48,7 @@
                try
                {
                    target[METADATA_PROPERTY] = new XObjMetadata();
-                   target.setPropertyIsEnumerable(METADATA_PROPERTY, false);
+                   //target.setPropertyIsEnumerable(METADATA_PROPERTY, false);
                    result = target[METADATA_PROPERTY];
                }
                catch (e:Error)
diff -r 333659592392 -r 8483b2203435 as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Mon Jun 08 15:05:46 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Tue Jun 09 13:39:22 2009 -0400
@@ -78,6 +78,9 @@
         {
             var classReference:Class = null;
             
+            if (!className)
+                return null;
+                
             try
             {
                  classReference = getDefinitionByName(className) as Class;
@@ -90,13 +93,19 @@
             return classReference;
          }    
 
+        public static function getClassName(obj:*):String
+        {
+            var className:String = getQualifiedClassName(obj);
+            return className;
+        }
+        
         /**
          * Return a Class instance based on a string class name
          * @private
           */
         public static function classOf(obj:*):Class
         {
-            var className:String = getQualifiedClassName(obj);
+            var className:String = getClassName(obj);
             var classReference:Class = getClassByName(className);
             
             return classReference;
diff -r 333659592392 -r 8483b2203435 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon Jun 08 15:05:46 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Tue Jun 09 13:39:22 2009 -0400
@@ -395,6 +395,10 @@
                     }
 
                     var partQName:XObjQName = new XObjQName(partNode.namespaceURI, XObjUtils.getNCName(partNode.nodeName));
+                    // TODO: allow type map entries to be full QNames, not just local names
+                    var partName:* = decodePartName(partQName, partNode);
+                    var propertyIsArray:Boolean = false;
+                    var propertyIsArrayCollection:Boolean = false;
 
                     // record the order we see the elements in for encoding purposes
                     // this is an attempt to "fake" XMLSchema sequence constraint of
@@ -406,66 +410,79 @@
                         elementSet.push(lastPartName);
                     }
                     
-                    // TODO: allow type map entries to be full QNames, not just local names
-                    var partName:* = decodePartName(partQName, partNode);
                     lastPartName.propname = partName;
+                  
+                    // what type do we want?
+                    var typeInfo:XObjTypeInfo = null;
+                    var partTypeName:String = null;
+                    var partClass:Class = null;
+                    var partObj:*;
 
-                    // what type do we want?
-                    var typeInfo:XObjTypeInfo = XObjUtils.typeInfoForProperty(result, resultTypeName, partName);
-                    var partTypeName:String = typeInfo.typeName;
-                    var propertyIsArray:Boolean = typeInfo.isArray;
-                    var propertyIsArrayCollection:Boolean = typeInfo.isArrayCollection;
-                    var partObj:*;
-                    
-                    if (partTypeName != null)
-                    {
-                        var partClass:Class = XObjUtils.getClassByName(partTypeName);
-                        
-                        // now, should we decode into a new object, or decode into an existing instance?
-                        if (!nextNodeIsRoot && result.hasOwnProperty(partName))
-                        {
-                            var existing:* = result[partName];
-                            if (existing && (existing is Object)
-                                && !((existing is Array) 
-                                    || (existing is ArrayCollection)
-                                    || (existing is String)
-                                    || (existing is Boolean)
-                                    )
-                                )
-                            {
-                                // reuse it
-                                rootObject = existing;
-                            }
-                            else
-                            {
-                                rootObject = null;
-                            }
-                        }
-                            
-                        if (partClass)
-                            partObj = actualDecodeXML(partNode, partClass, rootObject, nextNodeIsRoot);
-                        else
-                            partObj = actualDecodeXML(partNode, null, rootObject, nextNodeIsRoot);
-                    }
-                    else
-                        partObj = actualDecodeXML(partNode, null, rootObject, nextNodeIsRoot);
-                        
-                    // if we've seen this property before, assume it's an Array
+                    // look up characteristics of the result.propName type
+                    typeInfo = XObjUtils.typeInfoForProperty(result, resultTypeName, partName);
+                    partTypeName = typeInfo.typeName;
+                    propertyIsArray = typeInfo.isArray;
+                    propertyIsArrayCollection = typeInfo.isArrayCollection;
+
+                    // if we've seen this property before, force it to be an array
                     if (seenProperties[partName])
                     {
                         propertyIsArray = true;
                     }
+                      
+                    // assume we need a new part instance
+                    partObj = null;
                     
+                    // now, should we decode into a new object, or decode into an existing instance?
+                    if (nextNodeIsRoot)
+                    {
+                        // we're about to read the root element
+                        partObj = rootObject;
+                    }
+                    // else should we reuse existing property object?
+                    else if (!propertyIsArray 
+                    
+                        && result.hasOwnProperty(partName))
+                    {
+                        var existing:* = result[partName];
+                        if (existing && (existing is Object)
+                            && !((existing is Array) 
+                                || (existing is ArrayCollection)
+                                || (existing is String)
+                                || (existing is Boolean)
+                                || (existing is Number)
+                                )
+                            )
+                        {
+                            // reuse it
+                            partObj = existing;
+                        }
+                    }
+                    
+                    // if we have a partObj we need to use its class to decode into
+                    if (partObj)
+                    {
+                        partClass = XObjUtils.classOf(partObj);
+                    }
+                    else
+                    {
+                        partClass = XObjUtils.getClassByName(partTypeName);
+                    }
+                    
+                    // now finally, decode the part
+                    partObj = actualDecodeXML(partNode, partClass, partObj, nextNodeIsRoot);
+
+                    // and assign the result property based on array characteristics
                     result = assign(result, partName, partObj, seenProperties[partName], propertyIsArray, propertyIsArrayCollection, shouldMakeBindable);
                     
+                    seenProperties[partName] = true;
+
                     // should we keep an extra, well-known ref to the object?
                     if (nextNodeIsRoot && !doneRootDupe)
                     {
                         result = assign(result, "root", partObj, seenProperties[partName], propertyIsArray, propertyIsArrayCollection, shouldMakeBindable);
                         doneRootDupe = true;
                     }
-                    
-                    seenProperties[partName] = true;
                 }
             }
         }

From bpja@rpath.com Tue Jun  9 22:10:51 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n5A2ApF8002918
	for <xobj-commits@lists.rpath.com>; Wed, 10 Jun 2009 02:10:51 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n5A2Ap8o010617
	for <xobj-commits@lists.rpath.com>; Tue, 9 Jun 2009 22:10:51 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n5A2Ap1X008938
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 9 Jun 2009 22:10:51 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n5A2Akg0031151
	for <xobj-commits@lists.rpath.com>; Wed, 10 Jun 2009 02:10:46 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n5A2AfH9031093
	for xobj-commits@lists.rpath.com; Wed, 10 Jun 2009 02:10:41 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200906100210.n5A2AfH9031093@scc.eng.rpath.com>
Date: Wed, 10 Jun 2009 02:10:37 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: New tests for refreshing objects, including into array and
	arraycollections. Fixed handling of array on refresh. Added
	decodeXMLIntoObject() convenience method
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 10 Jun 2009 02:10:51 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3-test/src/TestSuite1.as as3/xobjas3-test/src/tests/TestBase.as as3/xobjas3-test/src/tests/TestBasics.as as3/xobjas3-test/src/tests/TestRefresh.as as3/xobjas3-test/src/tests/models/Middle.as as3/xobjas3-test/src/tests/models/SimpleTypesTest.as as3/xobjas3-test/src/tests/models/TestableObject.as as3/xobjas3-test/src/tests/models/Top.as as3/xobjas3-test/src/tests/models/TopWithArray.as as3/xobjas3-test/src/tests/models/TopWithArrayCollection.as as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as test/complex.xml

New tests for refreshing objects, including into array and arraycollections. Fixed handling of array on refresh. Added decodeXMLIntoObject() convenience method

diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3-test/src/TestSuite1.as
--- a/as3/xobjas3-test/src/TestSuite1.as	Tue Jun 09 13:39:22 2009 -0400
+++ b/as3/xobjas3-test/src/TestSuite1.as	Tue Jun 09 22:09:51 2009 -0400
@@ -24,6 +24,7 @@
         {
             addTestCase(new TestBasics());
             addTestCase(new TestTransients());
+            addTestCase(new TestRefresh());
         }
 
     }
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3-test/src/tests/TestBase.as
--- a/as3/xobjas3-test/src/tests/TestBase.as	Tue Jun 09 13:39:22 2009 -0400
+++ b/as3/xobjas3-test/src/tests/TestBase.as	Tue Jun 09 22:09:51 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3-test/src/tests/TestBasics.as
--- a/as3/xobjas3-test/src/tests/TestBasics.as	Tue Jun 09 13:39:22 2009 -0400
+++ b/as3/xobjas3-test/src/tests/TestBasics.as	Tue Jun 09 22:09:51 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
@@ -163,7 +163,7 @@
                 '    <tag>123</tag>\n'+
                 '  </middle>\n'+
                 '  <prop>abc</prop>\n'+
-                '</top>\n';
+                  '</top>\n';
         
         assertTrue(compareXMLtoString(xmlOutput, expectedString));
 
@@ -205,7 +205,7 @@
         var expectedString:String = 
                 '<obj>\n'+
                 '  <booleanVar>true</booleanVar>\n'+
-                '  <someVal>someval</someVal>\n'+                
+                '  <someVal>someval</someVal>\n'+
                 '</obj>\n';
         
         assertTrue(compareXMLtoString(xmlOutput, expectedString));
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3-test/src/tests/TestRefresh.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/TestRefresh.as	Tue Jun 09 22:09:51 2009 -0400
@@ -0,0 +1,187 @@
+/*
+#
+# Copyright (c) 2009 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests
+{
+import com.rpath.xobj.*;
+
+import flash.xml.XMLDocument;
+
+import mx.collections.ArrayCollection;
+
+import tests.models.*;
+
+public class TestRefresh extends TestBase
+{
+    /** testRefreshSimple 
+    * test basic refresh reload behavior of a simple XML document
+    */
+    
+    private var testValues:Array = [ "a string value 1", "a string value 2"];
+
+    private var refresh1:XML = 
+        <top dyn1="foo" dyn2="bar">
+          <dyn3>baz</dyn3>
+          <simple>simple</simple>
+          <middle>
+            <tag>1</tag>
+          </middle>
+          <bottom tag="2">
+          </bottom>
+            <testableObject someVal="a string value 1">
+                <someNumber>2.3</someNumber>
+            </testableObject>
+            <testableObject>
+                <someVal>a string value 2</someVal>
+                <someNumber>3.4</someNumber>
+            </testableObject>
+        </top>
+    
+    
+    public function testRefreshBaseData():void
+    {
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder({top:TopWithArray});
+        var xmlInput:XMLDocument = new XMLDocument(refresh1);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+        
+        assertTrue("Top is type Object", o.top is TopWithArray);
+        assertTrue("top has dynamic property 1 from attribute", o.top.dyn1 == "foo");
+        assertTrue("top has dynamic property 2 from attribute", o.top.dyn2 == "bar");
+        assertTrue("top has dynamic property 3 from element", o.top.dyn3 == "baz");
+        
+        assertTrue("top has array of TestableObjects from metadata marker", o.top.testableObject is Array);
+        
+        assertTrue("array of testables is correct length", o.top.testableObject.length == 2);
+        
+        var index:int = 0;
+        
+        for each (var item:* in o.top.testableObject)
+        {
+            assertTrue(item is TestableObject);
+            
+            var testable:TestableObject = item as TestableObject;
+            
+            assertTrue(testable.someVal == testValues[index]);
+            index++;
+        }
+
+    }
+    
+    public function testRefreshWithArray():void
+    {
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder({top:TopWithArray});
+        var xmlInput:XMLDocument = new XMLDocument(refresh1);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+        
+        // quick sanity check
+        assertTrue("top has dynamic property 1 from attribute", o.top.dyn1 == "foo");
+        
+        assertTrue("o.top and o.root are same instance", o.top === o.root);
+        
+        assertTrue("o.top is correct type", o.top is TopWithArray);
+        
+        var t:TopWithArray = o.top;
+        
+        // mutate the object state
+        
+        t.dyn1 = "foobarbaz";
+        assertTrue("top dyn1 changed", t.dyn1 == "foobarbaz");
+        
+        var arr:Array = t.testableObject;
+        
+        var newObj:*;
+        
+        // now, refresh the object by re-reading XML into itself
+        newObj = typedDecoder.decodeXMLIntoObject(xmlInput, t);
+        
+        var newT:TopWithArray;
+        
+        newT = newObj.root;
+        
+        assertTrue("refreshed into same instance object", t === newT);
+        
+        assertTrue("top dyn1 refreshed", t.dyn1 == "foo");
+        
+        assertTrue("testable array is same instance", t.testableObject === arr);
+        
+        // now change the arr instance and reload again
+        arr = [];
+        t.testableObject = arr;
+        assertTrue("testable array is empty", t.testableObject.length == 0);
+
+        // now, refresh the object by re-reading XML into itself
+        newObj = typedDecoder.decodeXMLIntoObject(xmlInput, t);
+        newT = newObj.root;
+
+        assertTrue("refreshed into same instance object", t === newT);
+
+        assertTrue("testable array is not empty", t.testableObject.length > 0);
+        assertTrue("testable array is same instance", t.testableObject === arr);
+    }
+
+
+    public function testRefreshWithArrayCollection():void
+    {
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder({top:TopWithArrayCollection});
+        var xmlInput:XMLDocument = new XMLDocument(refresh1);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+        
+        // quick sanity check
+        assertTrue("top has dynamic property 1 from attribute", o.top.dyn1 == "foo");
+        
+        assertTrue("o.top and o.root are same instance", o.top === o.root);
+        
+        assertTrue("o.top is correct type", o.top is TopWithArrayCollection);
+        
+        var t:TopWithArrayCollection = o.top;
+        
+        // mutate the object state
+        
+        t.dyn1 = "foobarbaz";
+        assertTrue("top dyn1 changed", t.dyn1 == "foobarbaz");
+        
+        var arr:ArrayCollection = t.testableObject;
+        
+        var newObj:*;
+        
+        // now, refresh the object by re-reading XML into itself
+        newObj = typedDecoder.decodeXMLIntoObject(xmlInput, t);
+        
+        var newT:TopWithArrayCollection;
+        
+        newT = newObj.root;
+        
+        assertTrue("refreshed into same instance object", t === newT);
+        
+        assertTrue("top dyn1 refreshed", t.dyn1 == "foo");
+        
+        assertTrue("testable arraycollection is same instance", t.testableObject === arr);
+        
+        // now change the arr instance and reload again
+        arr = new ArrayCollection();
+        t.testableObject = arr;
+        assertTrue("testable arraycollection is empty", t.testableObject.length == 0);
+
+        // now, refresh the object by re-reading XML into itself
+        newObj = typedDecoder.decodeXMLIntoObject(xmlInput, t);
+        newT = newObj.root;
+
+        assertTrue("refreshed into same instance object", t === newT);
+
+        assertTrue("testable arraycollection is not empty", t.testableObject.length > 0);
+        assertTrue("testable arraycollection is same instance", t.testableObject === arr);
+    }
+        
+}
+}
+
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3-test/src/tests/models/Middle.as
--- a/as3/xobjas3-test/src/tests/models/Middle.as	Tue Jun 09 13:39:22 2009 -0400
+++ b/as3/xobjas3-test/src/tests/models/Middle.as	Tue Jun 09 22:09:51 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3-test/src/tests/models/SimpleTypesTest.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/models/SimpleTypesTest.as	Tue Jun 09 22:09:51 2009 -0400
@@ -0,0 +1,29 @@
+/*
+#
+# Copyright (c) 2009 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests.models
+{
+    /**
+     * An object for use in validating encoding of objects
+     */ 
+    public class SimpleTypesTest
+    {
+        public var someVal:String;
+        
+        public var booleanVar:Boolean;
+        
+        public var someNumber:Number;
+        
+        public var anInt:int;
+    }
+}
\ No newline at end of file
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3-test/src/tests/models/TestableObject.as
--- a/as3/xobjas3-test/src/tests/models/TestableObject.as	Tue Jun 09 13:39:22 2009 -0400
+++ b/as3/xobjas3-test/src/tests/models/TestableObject.as	Tue Jun 09 22:09:51 2009 -0400
@@ -16,7 +16,7 @@
     /**
      * A random object for use in validating encoding of objects
      */ 
-    public class TestableObject
+    public dynamic class TestableObject
     {
         public var someVal:String;
         
@@ -27,5 +27,6 @@
         public var xobjTransientVar:String;
         
         public var booleanVar:Boolean;
+        
     }
 }
\ No newline at end of file
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3-test/src/tests/models/Top.as
--- a/as3/xobjas3-test/src/tests/models/Top.as	Tue Jun 09 13:39:22 2009 -0400
+++ b/as3/xobjas3-test/src/tests/models/Top.as	Tue Jun 09 22:09:51 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3-test/src/tests/models/TopWithArray.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/models/TopWithArray.as	Tue Jun 09 22:09:51 2009 -0400
@@ -0,0 +1,28 @@
+/*
+#
+# Copyright (c) 2009 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests.models
+{
+    public dynamic class TopWithArray
+    {
+        public function TopWithArray()
+        {
+        }
+
+        public var middle:Middle;
+        public var bottom:Middle;
+        
+        [ArrayElementType("tests.models.TestableObject")]
+        public var testableObject:Array;
+    }
+}
\ No newline at end of file
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3-test/src/tests/models/TopWithArrayCollection.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/models/TopWithArrayCollection.as	Tue Jun 09 22:09:51 2009 -0400
@@ -0,0 +1,30 @@
+/*
+#
+# Copyright (c) 2009 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests.models
+{
+    import mx.collections.ArrayCollection;
+    
+    public dynamic class TopWithArrayCollection
+    {
+        public function TopWithArrayCollection()
+        {
+        }
+
+        public var middle:Middle;
+        public var bottom:Middle;
+        
+        [ArrayElementType("tests.models.TestableObject")]
+        public var testableObject:ArrayCollection;
+    }
+}
\ No newline at end of file
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as	Tue Jun 09 13:39:22 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjDeferredDecode.as	Tue Jun 09 22:09:51 2009 -0400
@@ -6,26 +6,34 @@
     
     public class XObjDeferredDecode
     {
-        public function XObjDeferredDecode(xmlDecoder:XObjXMLDecoder, dataNode:XMLNode, propType:Class)
+        public function XObjDeferredDecode(xmlDecoder:XObjXMLDecoder, dataNode:XMLNode, propType:Class=null, rootObject:Object=null)
         {
             super();
             this.decoder = xmlDecoder;
             this.dataNode = dataNode;
             this.propType = propType;
+            this.rootObject = rootObject;
         }
 
         public var decoder:XObjXMLDecoder;
         public var dataNode:XMLNode;
         public var propType:Class;
+        public var rootObject:Object;
 
         
         public function decodeXML():Object
         {
-            return decoder.actualDecodeXML(dataNode, propType);
+            if (!rootObject)
+                return decoder.actualDecodeXML(dataNode, propType);
+            else
+                return decoder.actualDecodeXML(dataNode, null, rootObject, false);
         }
 
         public function decodeXMLIntoObject(rootObject:*):Object
         {
+            if (!rootObject)
+                return null;
+            
             return decoder.actualDecodeXML(dataNode, null, rootObject, false);
         }
         
diff -r 8483b2203435 -r ff73744ca5c9 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Tue Jun 09 13:39:22 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Tue Jun 09 22:09:51 2009 -0400
@@ -228,6 +228,16 @@
             return new XObjDeferredDecode(this, dataNode, propType);
     }
 
+    public function decodeXMLIntoObject(dataNode:XMLNode, rootObject:Object):Object
+    {
+        if (!rootObject)
+            return null;
+        
+        if (!deferred)
+            return actualDecodeXML(dataNode, null, rootObject);
+        else
+            return new XObjDeferredDecode(this, dataNode, null, rootObject);
+    }
 
     public function actualDecodeXML(dataNode:XMLNode, propType:Class = null, rootObject:* = null, isRootNode:Boolean = false):Object
     {
@@ -620,7 +630,7 @@
                     (existing as Array).splice(0, (existing as Array).length);
                 }
                 
-                existing = (existing as Array).concat(value);
+                (existing as Array).push(value);
             }
             else if (existing is ArrayCollection)
             {
@@ -686,7 +696,7 @@
                 }
                 else
                 {
-                    existing = (existing as Array).concat(value);
+                    (existing as Array).push(value);
                 }
             }
             
diff -r 8483b2203435 -r ff73744ca5c9 test/complex.xml
--- a/test/complex.xml	Tue Jun 09 13:39:22 2009 -0400
+++ b/test/complex.xml	Tue Jun 09 22:09:51 2009 -0400
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8'?>
-<top>
+<top >
   <prop>
     <subprop subattr="1">asdf</subprop>
     <subprop subattr="2">fdsa</subprop>

From bpja@rpath.com Tue Jun  9 23:32:27 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n5A3WQDv003149
	for <xobj-commits@lists.rpath.com>; Wed, 10 Jun 2009 03:32:26 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n5A3WQRr012266
	for <xobj-commits@lists.rpath.com>; Tue, 9 Jun 2009 23:32:26 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n5A3WQo9013528
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 9 Jun 2009 23:32:26 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n5A3WQEG002222
	for <xobj-commits@lists.rpath.com>; Wed, 10 Jun 2009 03:32:26 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n5A3WQBH002218
	for xobj-commits@lists.rpath.com; Wed, 10 Jun 2009 03:32:26 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200906100332.n5A3WQBH002218@scc.eng.rpath.com>
Date: Wed, 10 Jun 2009 03:32:25 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: More test cases
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 10 Jun 2009 03:32:27 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3-test/src/TestSuite1.as as3/xobjas3-test/src/tests/TestArrays.as as3/xobjas3-test/src/tests/models/TopWithNestedArray.as as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as as3/xobjas3/src/com/rpath/xobj/XObjUtils.as

More test cases

diff -r ff73744ca5c9 -r 4e3d51bb87de as3/xobjas3-test/src/TestSuite1.as
--- a/as3/xobjas3-test/src/TestSuite1.as	Tue Jun 09 22:09:51 2009 -0400
+++ b/as3/xobjas3-test/src/TestSuite1.as	Tue Jun 09 23:32:21 2009 -0400
@@ -25,6 +25,7 @@
             addTestCase(new TestBasics());
             addTestCase(new TestTransients());
             addTestCase(new TestRefresh());
+            addTestCase(new TestArrays());
         }
 
     }
diff -r ff73744ca5c9 -r 4e3d51bb87de as3/xobjas3-test/src/tests/TestArrays.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/TestArrays.as	Tue Jun 09 23:32:21 2009 -0400
@@ -0,0 +1,184 @@
+/*
+#
+# Copyright (c) 2009 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests
+{
+import com.rpath.xobj.*;
+
+import flash.xml.XMLDocument;
+
+import mx.collections.ArrayCollection;
+
+import tests.models.*;
+
+public class TestArrays extends TestBase
+{
+    /** testArrays 
+    * test basic handling of Array and ArrayCollection
+    */
+    
+    private var testValues:Array = [ "a string value 1", "a string value 2"];
+
+    private var arrayTest1:XML = 
+        <top dyn1="foo" dyn2="bar">
+          <dyn3>baz</dyn3>
+          <simple>simple</simple>
+          <middle>
+            <tag>1</tag>
+          </middle>
+          <bottom tag="2">
+          </bottom>
+            <testableObject someVal="a string value 1">
+                <someNumber>2.3</someNumber>
+            </testableObject>
+            <testableObject>
+                <someVal>a string value 2</someVal>
+                <someNumber>3.4</someNumber>
+            </testableObject>
+        </top>
+    
+    
+    public function testArray():void
+    {
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder({top:TopWithArray});
+        var xmlInput:XMLDocument = new XMLDocument(arrayTest1);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+        
+        assertTrue("Top is type Object", o.top is TopWithArray);
+        assertTrue("top has dynamic property 1 from attribute", o.top.dyn1 == "foo");
+        assertTrue("top has dynamic property 2 from attribute", o.top.dyn2 == "bar");
+        assertTrue("top has dynamic property 3 from element", o.top.dyn3 == "baz");
+        
+        assertTrue("top has array of TestableObjects from metadata marker", o.top.testableObject is Array);
+        
+        assertTrue("array of testables is correct length", o.top.testableObject.length == 2);
+        
+        var index:int = 0;
+        
+        for each (var item:* in o.top.testableObject)
+        {
+            assertTrue(item is TestableObject);
+            
+            var testable:TestableObject = item as TestableObject;
+            
+            assertTrue(testable.someVal == testValues[index]);
+            index++;
+        }
+
+    }
+
+
+    public function testArrayCollection():void
+    {
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder({top:TopWithArrayCollection});
+        var xmlInput:XMLDocument = new XMLDocument(arrayTest1);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+        
+        assertTrue("Top is type Object", o.top is TopWithArrayCollection);
+        assertTrue("top has dynamic property 1 from attribute", o.top.dyn1 == "foo");
+        assertTrue("top has dynamic property 2 from attribute", o.top.dyn2 == "bar");
+        assertTrue("top has dynamic property 3 from element", o.top.dyn3 == "baz");
+        
+        assertTrue("top has array of TestableObjects from metadata marker", o.top.testableObject is ArrayCollection);
+        
+        assertTrue("array of testables is correct length", o.top.testableObject.length == 2);
+        
+        var index:int = 0;
+        
+        for each (var item:* in o.top.testableObject)
+        {
+            assertTrue(item is TestableObject);
+            
+            var testable:TestableObject = item as TestableObject;
+            
+            assertTrue(testable.someVal == testValues[index]);
+            index++;
+        }
+
+    }
+
+    private var arrayTest2:XML = 
+        <top dyn1="foo" dyn2="bar">
+          <dyn3>baz</dyn3>
+          <simple>simple</simple>
+          <middle>
+            <tag>1</tag>
+          </middle>
+          <bottom tag="2">
+          </bottom>
+          <testableArray>
+            <testableObject someVal="a string value 1">
+                <someNumber>2.3</someNumber>
+            </testableObject>
+            <testableObject>
+                <someVal>a string value 2</someVal>
+                <someNumber>3.4</someNumber>
+            </testableObject>
+          </testableArray>
+        </top>
+    
+    
+    /** testNestedArray tests for elements nested under a grouping node
+    * 
+    * This does NOT yet work, since we have no way to disambiguate
+    * whether a tree means "object with a single property that is an array"
+    * or "array nested in a grouping alias element"
+    * 
+    * In the example above, <testableArray> is really an alias for the array
+    * of testableObjects. The un-nested form works fine, but does require the
+    * parent object property to be called testableObject as well, which can be 
+    * confusing
+    * 
+    * THIS DOES NOT WORK YET
+    */
+    
+    public function testNestedArray():void
+    {
+        // THIS DOESN'T WORK YET
+        return;
+        
+        var typedDecoder:XObjXMLDecoder = new XObjXMLDecoder({top:TopWithNestedArray});
+        var xmlInput:XMLDocument = new XMLDocument(arrayTest2);
+        var o:* = typedDecoder.decodeXML(xmlInput);
+        
+        assertTrue("Top is type Object", o.top is TopWithNestedArray);
+        assertTrue("top has dynamic property 1 from attribute", o.top.dyn1 == "foo");
+        assertTrue("top has dynamic property 2 from attribute", o.top.dyn2 == "bar");
+        assertTrue("top has dynamic property 3 from element", o.top.dyn3 == "baz");
+        
+        var t:TopWithNestedArray;
+        
+        t = o.top;
+        
+        assertTrue("top has array of TestableObjects from metadata marker", t.testableArray is Array);
+        
+        assertTrue("array of testables is correct length", t.testableArray.length == 2);
+        
+        var index:int = 0;
+        
+        for each (var item:* in t.testableArray)
+        {
+            assertTrue(item is TestableObject);
+            
+            var testable:TestableObject = item as TestableObject;
+            
+            assertTrue(testable.someVal == testValues[index]);
+            index++;
+        }
+
+    }
+
+
+}
+}
+
diff -r ff73744ca5c9 -r 4e3d51bb87de as3/xobjas3-test/src/tests/models/TopWithNestedArray.as
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3-test/src/tests/models/TopWithNestedArray.as	Tue Jun 09 23:32:21 2009 -0400
@@ -0,0 +1,28 @@
+/*
+#
+# Copyright (c) 2009 rPath, Inc.
+#
+# This program is distributed under the terms of the MIT License as found 
+# in a file called LICENSE. If it is not present, the license
+# is always available at http://www.opensource.org/licenses/mit-license.php.
+#
+# This program is distributed in the hope that it will be useful, but
+# without any waranty; without even the implied warranty of merchantability
+# or fitness for a particular purpose. See the MIT License for full details.
+*/
+
+package tests.models
+{
+    public dynamic class TopWithNestedArray
+    {
+        public function TopWithNestedArray()
+        {
+        }
+
+        public var middle:Middle;
+        public var bottom:Middle;
+        
+        [ArrayElementType("tests.models.TestableObject")]
+        public var testableArray:Array;
+    }
+}
\ No newline at end of file
diff -r ff73744ca5c9 -r 4e3d51bb87de as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as	Tue Jun 09 22:09:51 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as	Tue Jun 09 23:32:21 2009 -0400
@@ -8,6 +8,7 @@
 
         public var type:Class;
         public var typeName:String;
+        public var arrayElementTypeName:String;
         public var isArray:Boolean;
         public var isArrayCollection:Boolean;
         
diff -r ff73744ca5c9 -r 4e3d51bb87de as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Tue Jun 09 22:09:51 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Tue Jun 09 23:32:21 2009 -0400
@@ -209,6 +209,7 @@
                 
                 result.isArray = isTypeArray(result.typeName);
                 result.isArrayCollection = isTypeArrayCollection(result.typeName);
+                
                 if (result.isArray || result.isArrayCollection)
                 {
                     result.typeName = null; // assume generic object unless told otherwise
@@ -218,6 +219,7 @@
                 {
                     // use type specified
                     result.typeName = arrayElementType;
+                    result.arrayElementTypeName = arrayElementType;
                 }
                 
                 if (result.typeName == "Object"

From bmurphy@rpath.com Fri Jun 12 09:14:59 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n5CDExaT013393
	for <xobj-commits@lists.rpath.com>; Fri, 12 Jun 2009 13:14:59 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n5CDExOZ016069
	for <xobj-commits@lists.rpath.com>; Fri, 12 Jun 2009 09:14:59 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n5CDEwjF017821
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 12 Jun 2009 09:14:59 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n5CDEv5S014387
	for <xobj-commits@lists.rpath.com>; Fri, 12 Jun 2009 13:14:57 GMT
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n5CDEuPd014379
	for xobj-commits@lists.rpath.com; Fri, 12 Jun 2009 13:14:56 GMT
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200906121314.n5CDEuPd014379@scc.eng.rpath.com>
Date: Fri, 12 Jun 2009 13:14:54 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Added tag rba_5.2/rbo_06112009 for changeset 4e3d51bb87de
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 12 Jun 2009 13:14:59 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       .hgtags

Added tag rba_5.2/rbo_06112009 for changeset 4e3d51bb87de

diff -r 4e3d51bb87de -r 4a05f0f015c4 .hgtags
--- a/.hgtags	Tue Jun 09 23:32:21 2009 -0400
+++ b/.hgtags	Fri Jun 12 09:14:18 2009 -0400
@@ -2,3 +2,4 @@
 d19176ffd3f6141309af712a49793832aee43125 rbo_04292009
 3a485932d55fe293fc33ccdae3824981179977a8 rba_5.1.2
 3b318294880639e654575df816b59c1f13ac4425 rba_5.1.3
+4e3d51bb87de135fa87745a5847674fe13d21a70 rba_5.2/rbo_06112009

From misa@rpath.com Thu Jun 18 09:50:42 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n5IDogoC007512
	for <xobj-commits@lists.rpath.com>; Thu, 18 Jun 2009 13:50:42 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n5IDofok019398
	for <xobj-commits@lists.rpath.com>; Thu, 18 Jun 2009 09:50:41 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n5IDofLO008878
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 18 Jun 2009 09:50:41 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n5IDoeAo029436
	for <xobj-commits@lists.rpath.com>; Thu, 18 Jun 2009 13:50:40 GMT
Received: (from misa@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n5IDoeIc029427
	for xobj-commits@lists.rpath.com; Thu, 18 Jun 2009 13:50:40 GMT
From: Mihai Ibanescu <misa@rpath.com>
Message-Id: <200906181350.n5IDoeIc029427@scc.eng.rpath.com>
Date: Thu, 18 Jun 2009 13:50:40 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Fixed failing test
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Jun 2009 13:50:42 -0000

user:        Mihai Ibanescu <https://issues.rpath.com/>
files:       py/test/xobjtest.py

Fixed failing test

diff -r 03aacc2e16dc -r 34165a596370 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Wed Mar 25 13:32:10 2009 -0400
+++ b/py/test/xobjtest.py	Thu Jun 18 09:49:43 2009 -0400
@@ -817,7 +817,7 @@
         s.top.bar = u'\xf6'
         self.assertEquals(s.toxml(),
                 '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
-                '<top bar="&#xF6;">\n  <foo>\xc3\xb6</foo>\n</top>\n')
+                '<top bar="\xc3\xb6">\n  <foo>\xc3\xb6</foo>\n</top>\n')
 
 
 if __name__ == "__main__":

From misa@rpath.com Thu Jun 18 09:50:47 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n5IDokJP007518
	for <xobj-commits@lists.rpath.com>; Thu, 18 Jun 2009 13:50:46 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n5IDok3V019407
	for <xobj-commits@lists.rpath.com>; Thu, 18 Jun 2009 09:50:46 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n5IDokq2008884
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 18 Jun 2009 09:50:46 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n5IDojU4029475
	for <xobj-commits@lists.rpath.com>; Thu, 18 Jun 2009 13:50:45 GMT
Received: (from misa@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n5IDojj3029471
	for xobj-commits@lists.rpath.com; Thu, 18 Jun 2009 13:50:45 GMT
From: Mihai Ibanescu <misa@rpath.com>
Message-Id: <200906181350.n5IDojj3029471@scc.eng.rpath.com>
Date: Thu, 18 Jun 2009 13:50:45 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Branch merge
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 18 Jun 2009 13:50:47 -0000

tag:         tip
user:        Mihai Ibanescu <https://issues.rpath.com/>
files:       as3/xobjas3/xobj-flex-config.xml py/test/xobjtest.py

Branch merge

diff -r 34165a596370 -r 70647edf3923 as3/xobjas3/xobj-flex-config.xml
--- a/as3/xobjas3/xobj-flex-config.xml	Thu Jun 18 09:49:43 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,363 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright (c) 2009 rPath, Inc.
-
- This program is distributed under the terms of the MIT License as found 
- in a file called LICENSE. If it is not present, the license
- is always available at http://www.opensource.org/licenses/mit-license.php.
-
- This program is distributed in the hope that it will be useful, but
- without any waranty; without even the implied warranty of merchantability
- or fitness for a particular purpose. See the MIT License for full details.
- 
- <murf>  Note that we use our own config to support the xobjTransient
-         metadata tag.  There is a bug in ant compc preventing it from 
-         being usable there.
--->
-
-<flex-config>
-    <!-- Specifies the minimum player version that will run the compiled SWF. -->
-    <!-- 9.0.124 is the April 2008 security release -->
-    <target-player>9.0.124</target-player>
-
-   <compiler>
-
-      <!-- Turn on generation of accessible SWFs. -->
-      <accessible>false</accessible>
-
-      <!-- Specifies the locales for internationalization. -->
-      <locale>
-          <locale-element>en_US</locale-element>
-      </locale>
-
-      <!-- List of path elements that form the roots of ActionScript class hierarchies. -->
-      <!-- not set -->
-      <!--
-      <source-path>
-         <path-element>string</path-element>
-      </source-path>
-      -->
-
-     <!-- Allow the source-path to have path-elements which contain other path-elements -->
-     <allow-source-path-overlap>false</allow-source-path-overlap>
-
-      <!-- Run the AS3 compiler in a mode that detects legal but potentially incorrect -->
-      <!-- code.                                                                       -->
-      <show-actionscript-warnings>true</show-actionscript-warnings>
-
-      <!-- Turn on generation of debuggable SWFs. False by default for mxmlc, -->
-      <!-- but true by default for compc. -->
-      <!--
-      <debug>true</debug>
-      -->
-
-      <!-- List of SWC files or directories to compile against but to omit from -->
-      <!-- linking.                                                             -->
-      <external-library-path>
-          <path-element>/opt/flex-sdk-3/frameworks/libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>
-      </external-library-path>
-
-      <!-- Turn on writing of generated/*.as files to disk. These files are generated by -->
-      <!-- the compiler during mxml translation and are helpful with understanding and   -->
-      <!-- debugging Flex applications.                                                  -->
-      <keep-generated-actionscript>false</keep-generated-actionscript>
-
-      <!-- not set -->
-      <!--
-      <include-libraries>
-         <library>string</library>
-      </include-libraries>
-      -->
-
-      <!-- List of SWC files or directories that contain SWC files. -->
-      <library-path>
-         <path-element>/opt/flex-sdk-3/frameworks/libs</path-element>   
-		 <!-- keep the original location in the libpath for backwards-compatibility -->
-         <path-element>/opt/flex-sdk-3/frameworks/libs/player</path-element>
-         <path-element>/opt/flex-sdk-3/frameworks/libs/player/{targetPlayerMajorVersion}</path-element>    
-	     <path-element>/opt/flex-sdk-3/frameworks/locale/{locale}</path-element>
-      </library-path>
-
-      <namespaces>
-      <!-- Specify a URI to associate with a manifest of components for use as MXML -->
-      <!-- elements.                                                                -->
-         <namespace>
-            <uri>http://www.adobe.com/2006/mxml</uri>
-            <manifest>/opt/flex-sdk-3/frameworks/mxml-manifest.xml</manifest>
-         </namespace>
-      </namespaces>
-
-      <!-- Enable post-link SWF optimization. -->
-      <optimize>true</optimize>
-
-      <!-- Keep the following AS3 metadata in the bytecodes.                                             -->
-      <!-- Warning: For the data binding feature in the Flex framework to work properly,                 -->
-      <!--          the following metadata must be kept:                                                 -->
-      <!--          1. Bindable                                                                          -->
-      <!--          2. Managed                                                                           -->
-      <!--          3. ChangeEvent                                                                       -->
-      <!--          4. NonCommittingChangeEvent                                                          -->
-      <!--          5. Transient                                                                         -->
-      
-      <keep-as3-metadata>
-          <name>Bindable</name>
-          <name>Managed</name>
-          <name>ChangeEvent</name>
-          <name>NonCommittingChangeEvent</name>
-          <name>Transient</name>
-          <name>xobjTransient</name>
-      </keep-as3-metadata>
-     
-
-      <!-- Turn on reporting of data binding warnings. For example: Warning: Data binding -->
-      <!-- will not be able to detect assignments to "foo".                               -->
-      <show-binding-warnings>true</show-binding-warnings>
-
-      <!-- toggle whether warnings generated from unused type selectors are displayed -->
-      <show-unused-type-selector-warnings>true</show-unused-type-selector-warnings>
-
-      <!-- Run the AS3 compiler in strict error checking mode. -->
-      <strict>true</strict>
-
-      <!-- Use the ActionScript 3 class based object model for greater performance and better error reporting. -->
-      <!-- In the class based object model most built-in functions are implemented as fixed methods of classes -->
-      <!-- (-strict is recommended, but not required, for earlier errors) -->
-      <as3>true</as3>
-
-      <!-- Use the ECMAScript edition 3 prototype based object model to allow dynamic overriding of prototype -->
-      <!-- properties. In the prototype based object model built-in functions are implemented as dynamic      -->
-      <!-- properties of prototype objects (-strict is allowed, but may result in compiler errors for         -->
-      <!-- references to dynamic properties) -->
-      <es>false</es>
-
-      <!-- List of CSS or SWC files to apply as a theme. -->
-      <!-- not set -->
-      <!--
-      <theme>
-         <filename>string</filename>
-         <filename>string</filename>
-      </theme>
-      -->
-
-      <!-- Turns on the display of stack traces for uncaught runtime errors. -->
-      <verbose-stacktraces>false</verbose-stacktraces>
-
-      <!-- Defines the AS3 file encoding. -->
-      <!-- not set -->
-      <!--
-      <actionscript-file-encoding></actionscript-file-encoding>
-      -->
-
-      <fonts>
-
-          <!-- Enables advanced anti-aliasing for embedded fonts, which provides greater clarity for small -->
-          <!-- fonts. This setting can be overriden in CSS for specific fonts. -->
-          <!-- NOTE: flash-type has been deprecated. Please use advanced-anti-aliasing <flash-type>true</flash-type> -->
-          <advanced-anti-aliasing>true</advanced-anti-aliasing>
-
-          <!-- The number of embedded font faces that are cached. -->
-          <max-cached-fonts>20</max-cached-fonts>
-
-          <!-- The number of character glyph outlines to cache for each font face. -->
-          <max-glyphs-per-face>1000</max-glyphs-per-face>
-
-          <!-- Defines ranges that can be used across multiple font-face declarations. -->
-          <!-- See flash-unicode-table.xml for more examples. -->
-          <!-- not set -->
-          <!--
-          <languages>
-              <language-range>
-                  <lang>englishRange</lang>
-                  <range>U+0020-U+007E</range>
-              </language-range>
-          </languages>
-          -->
-
-          <!-- Compiler font manager classes, in policy resolution order-->
-          <managers>
-              <manager-class>flash.fonts.JREFontManager</manager-class>
-              <manager-class>flash.fonts.AFEFontManager</manager-class>
-              <manager-class>flash.fonts.BatikFontManager</manager-class>
-          </managers>
-
-          <!-- File containing cached system font licensing information produced via
-               java -cp mxmlc.jar flex2.tools.FontSnapshot (fontpath)
-               Will default to winFonts.ser on Windows XP and
-               macFonts.ser on Mac OS X, so is commented out by default.
-
-          <local-fonts-snapshot>localFonts.ser</local-fonts-snapshot>
-          -->
-
-      </fonts>
-
-      <!-- Array.toString() format has changed. -->
-      <warn-array-tostring-changes>false</warn-array-tostring-changes>
-
-      <!-- Assignment within conditional. -->
-      <warn-assignment-within-conditional>true</warn-assignment-within-conditional>
-
-      <!-- Possibly invalid Array cast operation. -->
-      <warn-bad-array-cast>true</warn-bad-array-cast>
-
-      <!-- Non-Boolean value used where a Boolean value was expected. -->
-      <warn-bad-bool-assignment>true</warn-bad-bool-assignment>
-
-      <!-- Invalid Date cast operation. -->
-      <warn-bad-date-cast>true</warn-bad-date-cast>
-
-      <!-- Unknown method. -->
-      <warn-bad-es3-type-method>true</warn-bad-es3-type-method>
-
-      <!-- Unknown property. -->
-      <warn-bad-es3-type-prop>true</warn-bad-es3-type-prop>
-
-      <!-- Illogical comparison with NaN. Any comparison operation involving NaN will evaluate to false because NaN != NaN. -->
-      <warn-bad-nan-comparison>true</warn-bad-nan-comparison>
-
-      <!-- Impossible assignment to null. -->
-      <warn-bad-null-assignment>true</warn-bad-null-assignment>
-
-      <!-- Illogical comparison with null. -->
-      <warn-bad-null-comparison>true</warn-bad-null-comparison>
-
-      <!-- Illogical comparison with undefined. Only untyped variables (or variables of type *) can be undefined. -->
-      <warn-bad-undefined-comparison>true</warn-bad-undefined-comparison>
-
-      <!-- Boolean() with no arguments returns false in ActionScript 3.0. Boolean() returned undefined in ActionScript 2.0. -->
-      <warn-boolean-constructor-with-no-args>false</warn-boolean-constructor-with-no-args>
-
-      <!-- __resolve is no longer supported. -->
-      <warn-changes-in-resolve>false</warn-changes-in-resolve>
-
-      <!-- Class is sealed. It cannot have members added to it dynamically. -->
-      <warn-class-is-sealed>true</warn-class-is-sealed>
-
-      <!-- Constant not initialized. -->
-      <warn-const-not-initialized>true</warn-const-not-initialized>
-
-      <!-- Function used in new expression returns a value. Result will be what the -->
-      <!-- function returns, rather than a new instance of that function.           -->
-      <warn-constructor-returns-value>false</warn-constructor-returns-value>
-
-      <!-- EventHandler was not added as a listener. -->
-      <warn-deprecated-event-handler-error>false</warn-deprecated-event-handler-error>
-
-      <!-- Unsupported ActionScript 2.0 function. -->
-      <warn-deprecated-function-error>true</warn-deprecated-function-error>
-
-      <!-- Unsupported ActionScript 2.0 property. -->
-      <warn-deprecated-property-error>true</warn-deprecated-property-error>
-
-      <!-- More than one argument by the same name. -->
-      <warn-duplicate-argument-names>true</warn-duplicate-argument-names>
-
-      <!-- Duplicate variable definition -->
-      <warn-duplicate-variable-def>true</warn-duplicate-variable-def>
-
-      <!-- ActionScript 3.0 iterates over an object's properties within a "for x in target" statement in random order. -->
-      <warn-for-var-in-changes>false</warn-for-var-in-changes>
-
-      <!-- Importing a package by the same name as the current class will hide that class identifier in this scope. -->
-      <warn-import-hides-class>true</warn-import-hides-class>
-
-      <!-- Use of the instanceof operator. -->
-      <warn-instance-of-changes>true</warn-instance-of-changes>
-
-      <!-- Internal error in compiler. -->
-      <warn-internal-error>true</warn-internal-error>
-
-      <!-- _level is no longer supported. For more information, see the flash.display package. -->
-      <warn-level-not-supported>true</warn-level-not-supported>
-
-      <!-- Missing namespace declaration (e.g. variable is not defined to be public, private, etc.). -->
-      <warn-missing-namespace-decl>true</warn-missing-namespace-decl>
-
-      <!-- Negative value will become a large positive value when assigned to a uint data type. -->
-      <warn-negative-uint-literal>true</warn-negative-uint-literal>
-
-      <!-- Missing constructor. -->
-      <warn-no-constructor>false</warn-no-constructor>
-
-      <!-- The super() statement was not called within the constructor. -->
-      <warn-no-explicit-super-call-in-constructor>false</warn-no-explicit-super-call-in-constructor>
-
-      <!-- Missing type declaration. -->
-      <warn-no-type-decl>true</warn-no-type-decl>
-
-      <!-- In ActionScript 3.0, white space is ignored and '' returns 0. Number() returns -->
-      <!-- NaN in ActionScript 2.0 when the parameter is '' or contains white space.      -->
-      <warn-number-from-string-changes>false</warn-number-from-string-changes>
-
-      <!-- Change in scoping for the this keyword. Class methods extracted from an  -->
-      <!-- instance of a class will always resolve this back to that instance. In   -->
-      <!-- ActionScript 2.0 this is looked up dynamically based on where the method -->
-      <!-- is invoked from.                                                         -->
-      <warn-scoping-change-in-this>false</warn-scoping-change-in-this>
-
-      <!-- Inefficient use of += on a TextField.-->
-      <warn-slow-text-field-addition>true</warn-slow-text-field-addition>
-
-      <!-- Possible missing parentheses. -->
-      <warn-unlikely-function-value>true</warn-unlikely-function-value>
-
-      <!-- Possible usage of the ActionScript 2.0 XML class. -->
-      <warn-xml-class-has-changed>false</warn-xml-class-has-changed>
-
-   </compiler>
-
-   <!-- compute-digest: writes a digest to the catalog.xml of a library. Use this when the library will be used as a
-                        cross-domain rsl.-->
-   <!-- compute-digest usage:
-   <compute-digest>boolean</compute-digest>
-   -->
-
-   <!-- A list of runtime shared library URLs to be loaded before applications start. -->
-   <!-- not set -->
-   <!--
-   <runtime-shared-libraries>
-      <url>string</url>
-      <url>string</url>
-   </runtime-shared-libraries>
-   -->
-
-   <!-- runtime-shared-library-path: specifies a SWC or directory to link against and an RSL URL to load with optional failover URLs -->
-   <runtime-shared-library-path>
-      <path-element>/opt/flex-sdk-3/frameworks/libs/framework.swc</path-element>
-      <rsl-url>framework_3.2.0.3958.swz</rsl-url>
-      <policy-file-url></policy-file-url>
-      <rsl-url>framework_3.2.0.3958.swf</rsl-url>
-      <policy-file-url></policy-file-url>
-   </runtime-shared-library-path>
-   <!-- static-link-runtime-shared-libraries: statically link the libraries specified by the -runtime-shared-libraries-path option.-->
-   <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
-
-   <!-- target-player: specifies the version of the player the application is targeting.
-                       Features requiring a later version will not be compiled into the application.
-                       The minimum value supported is "9.0.0".-->
-   <!-- target-player usage:
-   <target-player>version</target-player>
-   -->
-
-   <!-- Enables SWFs to access the network. -->
-   <use-network>true</use-network>
-
-   <!-- Metadata added to SWFs via the SWF Metadata tag. -->
-   <metadata>
-      <title>Adobe Flex 3 Application</title>
-      <description>http://www.adobe.com/products/flex</description>
-      <publisher>unknown</publisher>
-      <creator>unknown</creator>
-      <language>EN</language>
-   </metadata>
-
-   <!-- licenses: specifies a list of product and serial number pairs.
-   <licenses>
-      <license>
-         <product></product>
-         <serial-number></serial-number>
-      </license>
-   </licenses>
-   -->
-
-</flex-config>
diff -r 34165a596370 -r 70647edf3923 py/test/xobjtest.py
--- a/py/test/xobjtest.py	Thu Jun 18 09:49:43 2009 -0400
+++ b/py/test/xobjtest.py	Thu Jun 18 09:50:05 2009 -0400
@@ -503,7 +503,7 @@
             l = [ int ]
 
         d = xobj.parse("<top/>", typeMap = { 'top' : Top })
-        assert(d.top.l == [])
+        assert(d.top.l == None)
 
     def testUnion(self):
         class TypeA(xobj.XObj):
@@ -534,7 +534,7 @@
         assert(s == d.toxml(xml_declaration = False))
 
         d = xobj.parse('<top/>', typeMap = { 'top' : Top } )
-        assert(d.top.items == [])
+        assert(d.top.items == None)
 
     def testObjectTree(self):
         class Top(object):
@@ -820,5 +820,15 @@
                 '<top bar="\xc3\xb6">\n  <foo>\xc3\xb6</foo>\n</top>\n')
 
 
+    def testLong(self):
+        class Foo(object):
+            i = long
+
+        f = Foo()
+        f.i = 1 << 33
+        s = xobj.toxml(f, 'foo')
+        x = xobj.parse(s, typeMap = { 'foo' : Foo })
+        assert(x.foo.i == 1 << 33)
+
 if __name__ == "__main__":
     testsuite.main()

From bpja@rpath.com Wed Jun 24 13:30:42 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n5OHUgeF001355
	for <xobj-commits@lists.rpath.com>; Wed, 24 Jun 2009 17:30:42 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n5OHUfVI004275
	for <xobj-commits@lists.rpath.com>; Wed, 24 Jun 2009 13:30:41 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n5OHUfZ5006930
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 24 Jun 2009 13:30:41 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n5OHUeQH032386
	for <xobj-commits@lists.rpath.com>; Wed, 24 Jun 2009 17:30:40 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n5OHUdHZ032381
	for xobj-commits@lists.rpath.com; Wed, 24 Jun 2009 17:30:39 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200906241730.n5OHUdHZ032381@scc.eng.rpath.com>
Date: Wed, 24 Jun 2009 17:30:39 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Removed XMLSchemaAware code. Wasn't complete and is of no
	value any more. Cleaned up copyright statements throughout
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by
	lists-app.eqx-dc2-be.rpath.com id n5OHUgeF001355
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 24 Jun 2009 17:30:42 -0000

tag:         tip
user:        Brett Adam
files:       as3/XObjExplorer/src/XObjExplorer.mxml as3/XObjExplorer/src/test/Envelope.as as3/XObjExplorer/src/test/File.as as3/XObjExplorer/src/test/OVFId.as as3/XObjExplorer/src/test/TestObject.as as3/xobjas3-test/Makefile as3/xobjas3-test/Xvfb-wrapper.sh as3/xobjas3-test/build.properties as3/xobjas3-test/build.xml as3/xobjas3-test/src/TestRunner-app.xml as3/xobjas3-test/src/TestRunner.mxml as3/xobjas3-test/src/TestRunnerModules.mxml as3/xobjas3-test/src/TestSuite1.as as3/xobjas3-test/src/TestSuites.as as3/xobjas3-test/src/WebTestRunner.mxml as3/xobjas3-test/src/tests/TestData.mxml as3/xobjas3/.flexLibProperties as3/xobjas3/Makefile as3/xobjas3/build.properties as3/xobjas3/build.xml as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as as3/xobjas3/src/com/rpath/xobj/XObjQName.as as3/xobjas3/src/com/rpath/xobj/XObjString.as as3/xobjas3/src/com/rpath/xobj/XObjUtils.as as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as as3/xobjas3/src/xobj-manifest.xml

Removed XMLSchemaAware code. Wasn't complete and is of no value any more. Cleaned up copyright statements throughout

diff -r 70647edf3923 -r 71d6ed9e517f as3/XObjExplorer/src/XObjExplorer.mxml
--- a/as3/XObjExplorer/src/XObjExplorer.mxml	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/XObjExplorer/src/XObjExplorer.mxml	Wed Jun 24 13:30:36 2009 -0400
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
@@ -19,8 +19,6 @@
     <![CDATA[
     import com.rpath.xobj.XObjXMLEncoder;
     import com.rpath.xobj.XObjXMLDecoder;
-    import com.rpath.xobj.SchemaAwareXMLEncoder;
-    import com.rpath.xobj.SchemaAwareXMLDecoder;
     import mx.controls.Alert;
     import test.File;
     import mx.rpc.http.HTTPService;
@@ -48,36 +46,15 @@
     public var decoderChoices:ArrayCollection = new ArrayCollection(
         [
         { label: "Simple", value: "SIMPLE" },
-        { label: "Typed", value: "TYPED" },
-        { label: "Schema Aware", value: "SCHEMA" }
+        { label: "Typed", value: "TYPED" }
         ]
         );
 
-    private var schemaDecoder:SchemaAwareXMLDecoder;
-    private var schemaEncoder:SchemaAwareXMLEncoder;
     private var typeRegistry:SchemaTypeRegistry;
     private var schemaManager:SchemaManager;
     private var schemaMarshaller:SchemaMarshaller;
     private var schemaLoader:SchemaLoader;
 
-    private function setupSchemaHandling():void
-    {
-        schemaDecoder = new SchemaAwareXMLDecoder();
-        schemaDecoder.recordXSIType = true;
-
-        schemaEncoder = new SchemaAwareXMLEncoder();
-        
-        typeRegistry = schemaDecoder.typeRegistry;
-        schemaManager = schemaDecoder.schemaManager;
-        
-        schemaEncoder.schemaManager = schemaManager;
-        
-        schemaMarshaller = schemaManager.schemaMarshaller;
-        schemaLoader = new SchemaLoader();
-
-        schemaLoader.addEventListener(SchemaLoadEvent.LOAD, schemaLoaded);
-    }
-     
     [Bindable]
     public var isValid:Boolean;
     
@@ -113,15 +90,9 @@
     {
         testObject = new TestObject();
         BindingUtils.bindSetter(getInputXMLFromComboBox, filePicker, ["selectedItem"]);
-        
-        setupSchemaHandling();
     }
     
-    private function schemaLoaded(event:SchemaLoadEvent):void
-    {
-        schemaManager.addSchema(event.schema);
-        testObject = schemaDecoder.decode(new XML(inputXML), new QName("http://schemas.dmtf.org/ovf/envelope/1","Envelope"));
-    }
+
     
     public var oldTestObject:*;
 
@@ -181,12 +152,6 @@
                     newObject = typedDecoder.decodeXML(xmlNode);
                     break;
                     
-                    case "SCHEMA":                    
-                    typeRegistry.registerClass(new QName("http://schemas.dmtf.org/ovf/envelope/1","EnvelopeType"), test.Envelope);
-                    typeRegistry.registerClass(new QName("http://schemas.dmtf.org/ovf/envelope/1","DeploymentOptionSection_Type"), test.OVFId);
-                    schemaLoader.load("http://schemas.dmtf.org/ovf/envelope/1/dsp8023.xsd");
-                    newObject = {};
-                    break;
                 }
                     
                 
@@ -232,11 +197,6 @@
             unformattedOutput = xmlNode.firstChild.toString();
             break;
             
-            case "SCHEMA":
-            var schemaEncoder:SchemaAwareXMLEncoder = new SchemaAwareXMLEncoder();
-            xmlList = schemaEncoder.encode(testObject,null, new QName("http://schemas.dmtf.org/ovf/envelope/1","EnvelopeType"), null);
-            unformattedOutput = xmlList.toXMLString();
-            break;
         }
         
         //make the output look nice
diff -r 70647edf3923 -r 71d6ed9e517f as3/XObjExplorer/src/test/Envelope.as
--- a/as3/XObjExplorer/src/test/Envelope.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/XObjExplorer/src/test/Envelope.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/XObjExplorer/src/test/File.as
--- a/as3/XObjExplorer/src/test/File.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/XObjExplorer/src/test/File.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/XObjExplorer/src/test/OVFId.as
--- a/as3/XObjExplorer/src/test/OVFId.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/XObjExplorer/src/test/OVFId.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/XObjExplorer/src/test/TestObject.as
--- a/as3/XObjExplorer/src/test/TestObject.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/XObjExplorer/src/test/TestObject.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/Makefile
--- a/as3/xobjas3-test/Makefile	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/Makefile	Wed Jun 24 13:30:36 2009 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/Xvfb-wrapper.sh
--- a/as3/xobjas3-test/Xvfb-wrapper.sh	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/Xvfb-wrapper.sh	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/build.properties
--- a/as3/xobjas3-test/build.properties	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/build.properties	Wed Jun 24 13:30:36 2009 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/build.xml
--- a/as3/xobjas3-test/build.xml	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/build.xml	Wed Jun 24 13:30:36 2009 -0400
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 
 <!--
- Copyright (c) 2008 rPath, Inc.
+ Copyright (c) 2009 rPath, Inc.
 
  This program is distributed under the terms of the MIT License as found 
  in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/src/TestRunner-app.xml
--- a/as3/xobjas3-test/src/TestRunner-app.xml	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/src/TestRunner-app.xml	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
- Copyright (c) 2008 rPath, Inc.
+ Copyright (c) 2009 rPath, Inc.
 
  This program is distributed under the terms of the MIT License as found 
  in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/src/TestRunner.mxml
--- a/as3/xobjas3-test/src/TestRunner.mxml	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/src/TestRunner.mxml	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
- Copyright (c) 2008 rPath, Inc.
+ Copyright (c) 2009 rPath, Inc.
 
  This program is distributed under the terms of the MIT License as found 
  in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/src/TestRunnerModules.mxml
--- a/as3/xobjas3-test/src/TestRunnerModules.mxml	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/src/TestRunnerModules.mxml	Wed Jun 24 13:30:36 2009 -0400
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/src/TestSuite1.as
--- a/as3/xobjas3-test/src/TestSuite1.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/src/TestSuite1.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/src/TestSuites.as
--- a/as3/xobjas3-test/src/TestSuites.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/src/TestSuites.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/src/WebTestRunner.mxml
--- a/as3/xobjas3-test/src/WebTestRunner.mxml	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/src/WebTestRunner.mxml	Wed Jun 24 13:30:36 2009 -0400
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3-test/src/tests/TestData.mxml
--- a/as3/xobjas3-test/src/tests/TestData.mxml	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3-test/src/tests/TestData.mxml	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 <!--
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/.flexLibProperties
--- a/as3/xobjas3/.flexLibProperties	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/.flexLibProperties	Wed Jun 24 13:30:36 2009 -0400
@@ -6,11 +6,9 @@
 <classEntry path="com.rpath.xobj.XObjDeferredDecode"/>
 <classEntry path="com.rpath.xobj.XObjTypeInfo"/>
 <classEntry path="com.rpath.xobj.XObjString"/>
-<classEntry path="com.rpath.xobj.SchemaAwareXMLDecoder"/>
 <classEntry path="com.rpath.xobj.XObjVersion"/>
 <classEntry path="com.rpath.xobj.XObjQName"/>
 <classEntry path="com.rpath.xobj.XObjMetadata"/>
-<classEntry path="com.rpath.xobj.SchemaAwareXMLEncoder"/>
 <classEntry path="com.rpath.xobj.XObjXMLDecoder"/>
 </includeClasses>
 <includeResources/>
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/Makefile
--- a/as3/xobjas3/Makefile	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/Makefile	Wed Jun 24 13:30:36 2009 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/build.properties
--- a/as3/xobjas3/build.properties	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/build.properties	Wed Jun 24 13:30:36 2009 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/build.xml
--- a/as3/xobjas3/build.xml	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/build.xml	Wed Jun 24 13:30:36 2009 -0400
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 
 <!--
- Copyright (c) 2008 rPath, Inc.
+ Copyright (c) 2009 rPath, Inc.
 
  This program is distributed under the terms of the MIT License as found 
  in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjMetadata.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/src/com/rpath/xobj/XObjQName.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjQName.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjQName.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/src/com/rpath/xobj/XObjString.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjString.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjString.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLEncoder.as	Wed Jun 24 13:30:36 2009 -0400
@@ -1,6 +1,6 @@
 /*
 #
-# Copyright (c) 2008 rPath, Inc.
+# Copyright (c) 2009 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
diff -r 70647edf3923 -r 71d6ed9e517f as3/xobjas3/src/xobj-manifest.xml
--- a/as3/xobjas3/src/xobj-manifest.xml	Thu Jun 18 09:50:05 2009 -0400
+++ b/as3/xobjas3/src/xobj-manifest.xml	Wed Jun 24 13:30:36 2009 -0400
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 
 <!--
- Copyright (c) 2008 rPath, Inc.
+ Copyright (c) 2009 rPath, Inc.
 
  This program is distributed under the terms of the MIT License as found 
  in a file called LICENSE. If it is not present, the license


From bpja@rpath.com Wed Jun 24 17:22:51 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n5OLMp0W002048
	for <xobj-commits@lists.rpath.com>; Wed, 24 Jun 2009 21:22:51 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n5OLMoLT012538
	for <xobj-commits@lists.rpath.com>; Wed, 24 Jun 2009 17:22:50 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n5OLMoQ0023055
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 24 Jun 2009 17:22:50 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n5OLMlrc007406
	for <xobj-commits@lists.rpath.com>; Wed, 24 Jun 2009 21:22:47 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n5OLMkhD007401
	for xobj-commits@lists.rpath.com; Wed, 24 Jun 2009 21:22:46 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200906242122.n5OLMkhD007401@scc.eng.rpath.com>
Date: Wed, 24 Jun 2009 21:22:46 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Restoring xobj-flex-config.xml required by build
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 24 Jun 2009 21:22:51 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3/xobj-flex-config.xml

Restoring xobj-flex-config.xml required by build

diff -r 71d6ed9e517f -r 85c011fc0fe8 as3/xobjas3/xobj-flex-config.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/as3/xobjas3/xobj-flex-config.xml	Wed Jun 24 17:22:21 2009 -0400
@@ -0,0 +1,363 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright (c) 2009 rPath, Inc.
+
+ This program is distributed under the terms of the MIT License as found 
+ in a file called LICENSE. If it is not present, the license
+ is always available at http://www.opensource.org/licenses/mit-license.php.
+
+ This program is distributed in the hope that it will be useful, but
+ without any waranty; without even the implied warranty of merchantability
+ or fitness for a particular purpose. See the MIT License for full details.
+ 
+ <murf>  Note that we use our own config to support the xobjTransient
+         metadata tag.  There is a bug in ant compc preventing it from 
+         being usable there.
+-->
+
+<flex-config>
+    <!-- Specifies the minimum player version that will run the compiled SWF. -->
+    <!-- 9.0.124 is the April 2008 security release -->
+    <target-player>9.0.124</target-player>
+
+   <compiler>
+
+      <!-- Turn on generation of accessible SWFs. -->
+      <accessible>false</accessible>
+
+      <!-- Specifies the locales for internationalization. -->
+      <locale>
+          <locale-element>en_US</locale-element>
+      </locale>
+
+      <!-- List of path elements that form the roots of ActionScript class hierarchies. -->
+      <!-- not set -->
+      <!--
+      <source-path>
+         <path-element>string</path-element>
+      </source-path>
+      -->
+
+     <!-- Allow the source-path to have path-elements which contain other path-elements -->
+     <allow-source-path-overlap>false</allow-source-path-overlap>
+
+      <!-- Run the AS3 compiler in a mode that detects legal but potentially incorrect -->
+      <!-- code.                                                                       -->
+      <show-actionscript-warnings>true</show-actionscript-warnings>
+
+      <!-- Turn on generation of debuggable SWFs. False by default for mxmlc, -->
+      <!-- but true by default for compc. -->
+      <!--
+      <debug>true</debug>
+      -->
+
+      <!-- List of SWC files or directories to compile against but to omit from -->
+      <!-- linking.                                                             -->
+      <external-library-path>
+          <path-element>/opt/flex-sdk-3/frameworks/libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>
+      </external-library-path>
+
+      <!-- Turn on writing of generated/*.as files to disk. These files are generated by -->
+      <!-- the compiler during mxml translation and are helpful with understanding and   -->
+      <!-- debugging Flex applications.                                                  -->
+      <keep-generated-actionscript>false</keep-generated-actionscript>
+
+      <!-- not set -->
+      <!--
+      <include-libraries>
+         <library>string</library>
+      </include-libraries>
+      -->
+
+      <!-- List of SWC files or directories that contain SWC files. -->
+      <library-path>
+         <path-element>/opt/flex-sdk-3/frameworks/libs</path-element>   
+		 <!-- keep the original location in the libpath for backwards-compatibility -->
+         <path-element>/opt/flex-sdk-3/frameworks/libs/player</path-element>
+         <path-element>/opt/flex-sdk-3/frameworks/libs/player/{targetPlayerMajorVersion}</path-element>    
+	     <path-element>/opt/flex-sdk-3/frameworks/locale/{locale}</path-element>
+      </library-path>
+
+      <namespaces>
+      <!-- Specify a URI to associate with a manifest of components for use as MXML -->
+      <!-- elements.                                                                -->
+         <namespace>
+            <uri>http://www.adobe.com/2006/mxml</uri>
+            <manifest>/opt/flex-sdk-3/frameworks/mxml-manifest.xml</manifest>
+         </namespace>
+      </namespaces>
+
+      <!-- Enable post-link SWF optimization. -->
+      <optimize>true</optimize>
+
+      <!-- Keep the following AS3 metadata in the bytecodes.                                             -->
+      <!-- Warning: For the data binding feature in the Flex framework to work properly,                 -->
+      <!--          the following metadata must be kept:                                                 -->
+      <!--          1. Bindable                                                                          -->
+      <!--          2. Managed                                                                           -->
+      <!--          3. ChangeEvent                                                                       -->
+      <!--          4. NonCommittingChangeEvent                                                          -->
+      <!--          5. Transient                                                                         -->
+      
+      <keep-as3-metadata>
+          <name>Bindable</name>
+          <name>Managed</name>
+          <name>ChangeEvent</name>
+          <name>NonCommittingChangeEvent</name>
+          <name>Transient</name>
+          <name>xobjTransient</name>
+      </keep-as3-metadata>
+     
+
+      <!-- Turn on reporting of data binding warnings. For example: Warning: Data binding -->
+      <!-- will not be able to detect assignments to "foo".                               -->
+      <show-binding-warnings>true</show-binding-warnings>
+
+      <!-- toggle whether warnings generated from unused type selectors are displayed -->
+      <show-unused-type-selector-warnings>true</show-unused-type-selector-warnings>
+
+      <!-- Run the AS3 compiler in strict error checking mode. -->
+      <strict>true</strict>
+
+      <!-- Use the ActionScript 3 class based object model for greater performance and better error reporting. -->
+      <!-- In the class based object model most built-in functions are implemented as fixed methods of classes -->
+      <!-- (-strict is recommended, but not required, for earlier errors) -->
+      <as3>true</as3>
+
+      <!-- Use the ECMAScript edition 3 prototype based object model to allow dynamic overriding of prototype -->
+      <!-- properties. In the prototype based object model built-in functions are implemented as dynamic      -->
+      <!-- properties of prototype objects (-strict is allowed, but may result in compiler errors for         -->
+      <!-- references to dynamic properties) -->
+      <es>false</es>
+
+      <!-- List of CSS or SWC files to apply as a theme. -->
+      <!-- not set -->
+      <!--
+      <theme>
+         <filename>string</filename>
+         <filename>string</filename>
+      </theme>
+      -->
+
+      <!-- Turns on the display of stack traces for uncaught runtime errors. -->
+      <verbose-stacktraces>false</verbose-stacktraces>
+
+      <!-- Defines the AS3 file encoding. -->
+      <!-- not set -->
+      <!--
+      <actionscript-file-encoding></actionscript-file-encoding>
+      -->
+
+      <fonts>
+
+          <!-- Enables advanced anti-aliasing for embedded fonts, which provides greater clarity for small -->
+          <!-- fonts. This setting can be overriden in CSS for specific fonts. -->
+          <!-- NOTE: flash-type has been deprecated. Please use advanced-anti-aliasing <flash-type>true</flash-type> -->
+          <advanced-anti-aliasing>true</advanced-anti-aliasing>
+
+          <!-- The number of embedded font faces that are cached. -->
+          <max-cached-fonts>20</max-cached-fonts>
+
+          <!-- The number of character glyph outlines to cache for each font face. -->
+          <max-glyphs-per-face>1000</max-glyphs-per-face>
+
+          <!-- Defines ranges that can be used across multiple font-face declarations. -->
+          <!-- See flash-unicode-table.xml for more examples. -->
+          <!-- not set -->
+          <!--
+          <languages>
+              <language-range>
+                  <lang>englishRange</lang>
+                  <range>U+0020-U+007E</range>
+              </language-range>
+          </languages>
+          -->
+
+          <!-- Compiler font manager classes, in policy resolution order-->
+          <managers>
+              <manager-class>flash.fonts.JREFontManager</manager-class>
+              <manager-class>flash.fonts.AFEFontManager</manager-class>
+              <manager-class>flash.fonts.BatikFontManager</manager-class>
+          </managers>
+
+          <!-- File containing cached system font licensing information produced via
+               java -cp mxmlc.jar flex2.tools.FontSnapshot (fontpath)
+               Will default to winFonts.ser on Windows XP and
+               macFonts.ser on Mac OS X, so is commented out by default.
+
+          <local-fonts-snapshot>localFonts.ser</local-fonts-snapshot>
+          -->
+
+      </fonts>
+
+      <!-- Array.toString() format has changed. -->
+      <warn-array-tostring-changes>false</warn-array-tostring-changes>
+
+      <!-- Assignment within conditional. -->
+      <warn-assignment-within-conditional>true</warn-assignment-within-conditional>
+
+      <!-- Possibly invalid Array cast operation. -->
+      <warn-bad-array-cast>true</warn-bad-array-cast>
+
+      <!-- Non-Boolean value used where a Boolean value was expected. -->
+      <warn-bad-bool-assignment>true</warn-bad-bool-assignment>
+
+      <!-- Invalid Date cast operation. -->
+      <warn-bad-date-cast>true</warn-bad-date-cast>
+
+      <!-- Unknown method. -->
+      <warn-bad-es3-type-method>true</warn-bad-es3-type-method>
+
+      <!-- Unknown property. -->
+      <warn-bad-es3-type-prop>true</warn-bad-es3-type-prop>
+
+      <!-- Illogical comparison with NaN. Any comparison operation involving NaN will evaluate to false because NaN != NaN. -->
+      <warn-bad-nan-comparison>true</warn-bad-nan-comparison>
+
+      <!-- Impossible assignment to null. -->
+      <warn-bad-null-assignment>true</warn-bad-null-assignment>
+
+      <!-- Illogical comparison with null. -->
+      <warn-bad-null-comparison>true</warn-bad-null-comparison>
+
+      <!-- Illogical comparison with undefined. Only untyped variables (or variables of type *) can be undefined. -->
+      <warn-bad-undefined-comparison>true</warn-bad-undefined-comparison>
+
+      <!-- Boolean() with no arguments returns false in ActionScript 3.0. Boolean() returned undefined in ActionScript 2.0. -->
+      <warn-boolean-constructor-with-no-args>false</warn-boolean-constructor-with-no-args>
+
+      <!-- __resolve is no longer supported. -->
+      <warn-changes-in-resolve>false</warn-changes-in-resolve>
+
+      <!-- Class is sealed. It cannot have members added to it dynamically. -->
+      <warn-class-is-sealed>true</warn-class-is-sealed>
+
+      <!-- Constant not initialized. -->
+      <warn-const-not-initialized>true</warn-const-not-initialized>
+
+      <!-- Function used in new expression returns a value. Result will be what the -->
+      <!-- function returns, rather than a new instance of that function.           -->
+      <warn-constructor-returns-value>false</warn-constructor-returns-value>
+
+      <!-- EventHandler was not added as a listener. -->
+      <warn-deprecated-event-handler-error>false</warn-deprecated-event-handler-error>
+
+      <!-- Unsupported ActionScript 2.0 function. -->
+      <warn-deprecated-function-error>true</warn-deprecated-function-error>
+
+      <!-- Unsupported ActionScript 2.0 property. -->
+      <warn-deprecated-property-error>true</warn-deprecated-property-error>
+
+      <!-- More than one argument by the same name. -->
+      <warn-duplicate-argument-names>true</warn-duplicate-argument-names>
+
+      <!-- Duplicate variable definition -->
+      <warn-duplicate-variable-def>true</warn-duplicate-variable-def>
+
+      <!-- ActionScript 3.0 iterates over an object's properties within a "for x in target" statement in random order. -->
+      <warn-for-var-in-changes>false</warn-for-var-in-changes>
+
+      <!-- Importing a package by the same name as the current class will hide that class identifier in this scope. -->
+      <warn-import-hides-class>true</warn-import-hides-class>
+
+      <!-- Use of the instanceof operator. -->
+      <warn-instance-of-changes>true</warn-instance-of-changes>
+
+      <!-- Internal error in compiler. -->
+      <warn-internal-error>true</warn-internal-error>
+
+      <!-- _level is no longer supported. For more information, see the flash.display package. -->
+      <warn-level-not-supported>true</warn-level-not-supported>
+
+      <!-- Missing namespace declaration (e.g. variable is not defined to be public, private, etc.). -->
+      <warn-missing-namespace-decl>true</warn-missing-namespace-decl>
+
+      <!-- Negative value will become a large positive value when assigned to a uint data type. -->
+      <warn-negative-uint-literal>true</warn-negative-uint-literal>
+
+      <!-- Missing constructor. -->
+      <warn-no-constructor>false</warn-no-constructor>
+
+      <!-- The super() statement was not called within the constructor. -->
+      <warn-no-explicit-super-call-in-constructor>false</warn-no-explicit-super-call-in-constructor>
+
+      <!-- Missing type declaration. -->
+      <warn-no-type-decl>true</warn-no-type-decl>
+
+      <!-- In ActionScript 3.0, white space is ignored and '' returns 0. Number() returns -->
+      <!-- NaN in ActionScript 2.0 when the parameter is '' or contains white space.      -->
+      <warn-number-from-string-changes>false</warn-number-from-string-changes>
+
+      <!-- Change in scoping for the this keyword. Class methods extracted from an  -->
+      <!-- instance of a class will always resolve this back to that instance. In   -->
+      <!-- ActionScript 2.0 this is looked up dynamically based on where the method -->
+      <!-- is invoked from.                                                         -->
+      <warn-scoping-change-in-this>false</warn-scoping-change-in-this>
+
+      <!-- Inefficient use of += on a TextField.-->
+      <warn-slow-text-field-addition>true</warn-slow-text-field-addition>
+
+      <!-- Possible missing parentheses. -->
+      <warn-unlikely-function-value>true</warn-unlikely-function-value>
+
+      <!-- Possible usage of the ActionScript 2.0 XML class. -->
+      <warn-xml-class-has-changed>false</warn-xml-class-has-changed>
+
+   </compiler>
+
+   <!-- compute-digest: writes a digest to the catalog.xml of a library. Use this when the library will be used as a
+                        cross-domain rsl.-->
+   <!-- compute-digest usage:
+   <compute-digest>boolean</compute-digest>
+   -->
+
+   <!-- A list of runtime shared library URLs to be loaded before applications start. -->
+   <!-- not set -->
+   <!--
+   <runtime-shared-libraries>
+      <url>string</url>
+      <url>string</url>
+   </runtime-shared-libraries>
+   -->
+
+   <!-- runtime-shared-library-path: specifies a SWC or directory to link against and an RSL URL to load with optional failover URLs -->
+   <runtime-shared-library-path>
+      <path-element>/opt/flex-sdk-3/frameworks/libs/framework.swc</path-element>
+      <rsl-url>framework_3.2.0.3958.swz</rsl-url>
+      <policy-file-url></policy-file-url>
+      <rsl-url>framework_3.2.0.3958.swf</rsl-url>
+      <policy-file-url></policy-file-url>
+   </runtime-shared-library-path>
+   <!-- static-link-runtime-shared-libraries: statically link the libraries specified by the -runtime-shared-libraries-path option.-->
+   <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
+
+   <!-- target-player: specifies the version of the player the application is targeting.
+                       Features requiring a later version will not be compiled into the application.
+                       The minimum value supported is "9.0.0".-->
+   <!-- target-player usage:
+   <target-player>version</target-player>
+   -->
+
+   <!-- Enables SWFs to access the network. -->
+   <use-network>true</use-network>
+
+   <!-- Metadata added to SWFs via the SWF Metadata tag. -->
+   <metadata>
+      <title>Adobe Flex 3 Application</title>
+      <description>http://www.adobe.com/products/flex</description>
+      <publisher>unknown</publisher>
+      <creator>unknown</creator>
+      <language>EN</language>
+   </metadata>
+
+   <!-- licenses: specifies a list of product and serial number pairs.
+   <licenses>
+      <license>
+         <product></product>
+         <serial-number></serial-number>
+      </license>
+   </licenses>
+   -->
+
+</flex-config>

From bmurphy@rpath.com Thu Jun 25 13:42:39 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n5PHgdSU005834
	for <xobj-commits@lists.rpath.com>; Thu, 25 Jun 2009 17:42:39 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n5PHgcTL015581
	for <xobj-commits@lists.rpath.com>; Thu, 25 Jun 2009 13:42:38 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.13.6/8.13.4) with ESMTP id n5PHgcx6031862
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 25 Jun 2009 13:42:38 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n5PHgbB2001781
	for <xobj-commits@lists.rpath.com>; Thu, 25 Jun 2009 17:42:37 GMT
Received: (from bmurphy@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n5PHgbCM001769
	for xobj-commits@lists.rpath.com; Thu, 25 Jun 2009 17:42:37 GMT
From: Brad Murphy <bmurphy@rpath.com>
Message-Id: <200906251742.n5PHgbCM001769@scc.eng.rpath.com>
Date: Thu, 25 Jun 2009 17:42:37 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: xobj-flex-config.xml isn't used anymore.  It was
	accidentally removed and put back, but now I am removing it for good.
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 25 Jun 2009 17:42:39 -0000

tag:         tip
user:        Brad Murphy <https://issues.rpath.com>
files:       as3/xobjas3/xobj-flex-config.xml

xobj-flex-config.xml isn't used anymore.  It was accidentally removed and put back, but now I am removing it for good.

diff -r 85c011fc0fe8 -r 08bc3627a2fc as3/xobjas3/xobj-flex-config.xml
--- a/as3/xobjas3/xobj-flex-config.xml	Wed Jun 24 17:22:21 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,363 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright (c) 2009 rPath, Inc.
-
- This program is distributed under the terms of the MIT License as found 
- in a file called LICENSE. If it is not present, the license
- is always available at http://www.opensource.org/licenses/mit-license.php.
-
- This program is distributed in the hope that it will be useful, but
- without any waranty; without even the implied warranty of merchantability
- or fitness for a particular purpose. See the MIT License for full details.
- 
- <murf>  Note that we use our own config to support the xobjTransient
-         metadata tag.  There is a bug in ant compc preventing it from 
-         being usable there.
--->
-
-<flex-config>
-    <!-- Specifies the minimum player version that will run the compiled SWF. -->
-    <!-- 9.0.124 is the April 2008 security release -->
-    <target-player>9.0.124</target-player>
-
-   <compiler>
-
-      <!-- Turn on generation of accessible SWFs. -->
-      <accessible>false</accessible>
-
-      <!-- Specifies the locales for internationalization. -->
-      <locale>
-          <locale-element>en_US</locale-element>
-      </locale>
-
-      <!-- List of path elements that form the roots of ActionScript class hierarchies. -->
-      <!-- not set -->
-      <!--
-      <source-path>
-         <path-element>string</path-element>
-      </source-path>
-      -->
-
-     <!-- Allow the source-path to have path-elements which contain other path-elements -->
-     <allow-source-path-overlap>false</allow-source-path-overlap>
-
-      <!-- Run the AS3 compiler in a mode that detects legal but potentially incorrect -->
-      <!-- code.                                                                       -->
-      <show-actionscript-warnings>true</show-actionscript-warnings>
-
-      <!-- Turn on generation of debuggable SWFs. False by default for mxmlc, -->
-      <!-- but true by default for compc. -->
-      <!--
-      <debug>true</debug>
-      -->
-
-      <!-- List of SWC files or directories to compile against but to omit from -->
-      <!-- linking.                                                             -->
-      <external-library-path>
-          <path-element>/opt/flex-sdk-3/frameworks/libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>
-      </external-library-path>
-
-      <!-- Turn on writing of generated/*.as files to disk. These files are generated by -->
-      <!-- the compiler during mxml translation and are helpful with understanding and   -->
-      <!-- debugging Flex applications.                                                  -->
-      <keep-generated-actionscript>false</keep-generated-actionscript>
-
-      <!-- not set -->
-      <!--
-      <include-libraries>
-         <library>string</library>
-      </include-libraries>
-      -->
-
-      <!-- List of SWC files or directories that contain SWC files. -->
-      <library-path>
-         <path-element>/opt/flex-sdk-3/frameworks/libs</path-element>   
-		 <!-- keep the original location in the libpath for backwards-compatibility -->
-         <path-element>/opt/flex-sdk-3/frameworks/libs/player</path-element>
-         <path-element>/opt/flex-sdk-3/frameworks/libs/player/{targetPlayerMajorVersion}</path-element>    
-	     <path-element>/opt/flex-sdk-3/frameworks/locale/{locale}</path-element>
-      </library-path>
-
-      <namespaces>
-      <!-- Specify a URI to associate with a manifest of components for use as MXML -->
-      <!-- elements.                                                                -->
-         <namespace>
-            <uri>http://www.adobe.com/2006/mxml</uri>
-            <manifest>/opt/flex-sdk-3/frameworks/mxml-manifest.xml</manifest>
-         </namespace>
-      </namespaces>
-
-      <!-- Enable post-link SWF optimization. -->
-      <optimize>true</optimize>
-
-      <!-- Keep the following AS3 metadata in the bytecodes.                                             -->
-      <!-- Warning: For the data binding feature in the Flex framework to work properly,                 -->
-      <!--          the following metadata must be kept:                                                 -->
-      <!--          1. Bindable                                                                          -->
-      <!--          2. Managed                                                                           -->
-      <!--          3. ChangeEvent                                                                       -->
-      <!--          4. NonCommittingChangeEvent                                                          -->
-      <!--          5. Transient                                                                         -->
-      
-      <keep-as3-metadata>
-          <name>Bindable</name>
-          <name>Managed</name>
-          <name>ChangeEvent</name>
-          <name>NonCommittingChangeEvent</name>
-          <name>Transient</name>
-          <name>xobjTransient</name>
-      </keep-as3-metadata>
-     
-
-      <!-- Turn on reporting of data binding warnings. For example: Warning: Data binding -->
-      <!-- will not be able to detect assignments to "foo".                               -->
-      <show-binding-warnings>true</show-binding-warnings>
-
-      <!-- toggle whether warnings generated from unused type selectors are displayed -->
-      <show-unused-type-selector-warnings>true</show-unused-type-selector-warnings>
-
-      <!-- Run the AS3 compiler in strict error checking mode. -->
-      <strict>true</strict>
-
-      <!-- Use the ActionScript 3 class based object model for greater performance and better error reporting. -->
-      <!-- In the class based object model most built-in functions are implemented as fixed methods of classes -->
-      <!-- (-strict is recommended, but not required, for earlier errors) -->
-      <as3>true</as3>
-
-      <!-- Use the ECMAScript edition 3 prototype based object model to allow dynamic overriding of prototype -->
-      <!-- properties. In the prototype based object model built-in functions are implemented as dynamic      -->
-      <!-- properties of prototype objects (-strict is allowed, but may result in compiler errors for         -->
-      <!-- references to dynamic properties) -->
-      <es>false</es>
-
-      <!-- List of CSS or SWC files to apply as a theme. -->
-      <!-- not set -->
-      <!--
-      <theme>
-         <filename>string</filename>
-         <filename>string</filename>
-      </theme>
-      -->
-
-      <!-- Turns on the display of stack traces for uncaught runtime errors. -->
-      <verbose-stacktraces>false</verbose-stacktraces>
-
-      <!-- Defines the AS3 file encoding. -->
-      <!-- not set -->
-      <!--
-      <actionscript-file-encoding></actionscript-file-encoding>
-      -->
-
-      <fonts>
-
-          <!-- Enables advanced anti-aliasing for embedded fonts, which provides greater clarity for small -->
-          <!-- fonts. This setting can be overriden in CSS for specific fonts. -->
-          <!-- NOTE: flash-type has been deprecated. Please use advanced-anti-aliasing <flash-type>true</flash-type> -->
-          <advanced-anti-aliasing>true</advanced-anti-aliasing>
-
-          <!-- The number of embedded font faces that are cached. -->
-          <max-cached-fonts>20</max-cached-fonts>
-
-          <!-- The number of character glyph outlines to cache for each font face. -->
-          <max-glyphs-per-face>1000</max-glyphs-per-face>
-
-          <!-- Defines ranges that can be used across multiple font-face declarations. -->
-          <!-- See flash-unicode-table.xml for more examples. -->
-          <!-- not set -->
-          <!--
-          <languages>
-              <language-range>
-                  <lang>englishRange</lang>
-                  <range>U+0020-U+007E</range>
-              </language-range>
-          </languages>
-          -->
-
-          <!-- Compiler font manager classes, in policy resolution order-->
-          <managers>
-              <manager-class>flash.fonts.JREFontManager</manager-class>
-              <manager-class>flash.fonts.AFEFontManager</manager-class>
-              <manager-class>flash.fonts.BatikFontManager</manager-class>
-          </managers>
-
-          <!-- File containing cached system font licensing information produced via
-               java -cp mxmlc.jar flex2.tools.FontSnapshot (fontpath)
-               Will default to winFonts.ser on Windows XP and
-               macFonts.ser on Mac OS X, so is commented out by default.
-
-          <local-fonts-snapshot>localFonts.ser</local-fonts-snapshot>
-          -->
-
-      </fonts>
-
-      <!-- Array.toString() format has changed. -->
-      <warn-array-tostring-changes>false</warn-array-tostring-changes>
-
-      <!-- Assignment within conditional. -->
-      <warn-assignment-within-conditional>true</warn-assignment-within-conditional>
-
-      <!-- Possibly invalid Array cast operation. -->
-      <warn-bad-array-cast>true</warn-bad-array-cast>
-
-      <!-- Non-Boolean value used where a Boolean value was expected. -->
-      <warn-bad-bool-assignment>true</warn-bad-bool-assignment>
-
-      <!-- Invalid Date cast operation. -->
-      <warn-bad-date-cast>true</warn-bad-date-cast>
-
-      <!-- Unknown method. -->
-      <warn-bad-es3-type-method>true</warn-bad-es3-type-method>
-
-      <!-- Unknown property. -->
-      <warn-bad-es3-type-prop>true</warn-bad-es3-type-prop>
-
-      <!-- Illogical comparison with NaN. Any comparison operation involving NaN will evaluate to false because NaN != NaN. -->
-      <warn-bad-nan-comparison>true</warn-bad-nan-comparison>
-
-      <!-- Impossible assignment to null. -->
-      <warn-bad-null-assignment>true</warn-bad-null-assignment>
-
-      <!-- Illogical comparison with null. -->
-      <warn-bad-null-comparison>true</warn-bad-null-comparison>
-
-      <!-- Illogical comparison with undefined. Only untyped variables (or variables of type *) can be undefined. -->
-      <warn-bad-undefined-comparison>true</warn-bad-undefined-comparison>
-
-      <!-- Boolean() with no arguments returns false in ActionScript 3.0. Boolean() returned undefined in ActionScript 2.0. -->
-      <warn-boolean-constructor-with-no-args>false</warn-boolean-constructor-with-no-args>
-
-      <!-- __resolve is no longer supported. -->
-      <warn-changes-in-resolve>false</warn-changes-in-resolve>
-
-      <!-- Class is sealed. It cannot have members added to it dynamically. -->
-      <warn-class-is-sealed>true</warn-class-is-sealed>
-
-      <!-- Constant not initialized. -->
-      <warn-const-not-initialized>true</warn-const-not-initialized>
-
-      <!-- Function used in new expression returns a value. Result will be what the -->
-      <!-- function returns, rather than a new instance of that function.           -->
-      <warn-constructor-returns-value>false</warn-constructor-returns-value>
-
-      <!-- EventHandler was not added as a listener. -->
-      <warn-deprecated-event-handler-error>false</warn-deprecated-event-handler-error>
-
-      <!-- Unsupported ActionScript 2.0 function. -->
-      <warn-deprecated-function-error>true</warn-deprecated-function-error>
-
-      <!-- Unsupported ActionScript 2.0 property. -->
-      <warn-deprecated-property-error>true</warn-deprecated-property-error>
-
-      <!-- More than one argument by the same name. -->
-      <warn-duplicate-argument-names>true</warn-duplicate-argument-names>
-
-      <!-- Duplicate variable definition -->
-      <warn-duplicate-variable-def>true</warn-duplicate-variable-def>
-
-      <!-- ActionScript 3.0 iterates over an object's properties within a "for x in target" statement in random order. -->
-      <warn-for-var-in-changes>false</warn-for-var-in-changes>
-
-      <!-- Importing a package by the same name as the current class will hide that class identifier in this scope. -->
-      <warn-import-hides-class>true</warn-import-hides-class>
-
-      <!-- Use of the instanceof operator. -->
-      <warn-instance-of-changes>true</warn-instance-of-changes>
-
-      <!-- Internal error in compiler. -->
-      <warn-internal-error>true</warn-internal-error>
-
-      <!-- _level is no longer supported. For more information, see the flash.display package. -->
-      <warn-level-not-supported>true</warn-level-not-supported>
-
-      <!-- Missing namespace declaration (e.g. variable is not defined to be public, private, etc.). -->
-      <warn-missing-namespace-decl>true</warn-missing-namespace-decl>
-
-      <!-- Negative value will become a large positive value when assigned to a uint data type. -->
-      <warn-negative-uint-literal>true</warn-negative-uint-literal>
-
-      <!-- Missing constructor. -->
-      <warn-no-constructor>false</warn-no-constructor>
-
-      <!-- The super() statement was not called within the constructor. -->
-      <warn-no-explicit-super-call-in-constructor>false</warn-no-explicit-super-call-in-constructor>
-
-      <!-- Missing type declaration. -->
-      <warn-no-type-decl>true</warn-no-type-decl>
-
-      <!-- In ActionScript 3.0, white space is ignored and '' returns 0. Number() returns -->
-      <!-- NaN in ActionScript 2.0 when the parameter is '' or contains white space.      -->
-      <warn-number-from-string-changes>false</warn-number-from-string-changes>
-
-      <!-- Change in scoping for the this keyword. Class methods extracted from an  -->
-      <!-- instance of a class will always resolve this back to that instance. In   -->
-      <!-- ActionScript 2.0 this is looked up dynamically based on where the method -->
-      <!-- is invoked from.                                                         -->
-      <warn-scoping-change-in-this>false</warn-scoping-change-in-this>
-
-      <!-- Inefficient use of += on a TextField.-->
-      <warn-slow-text-field-addition>true</warn-slow-text-field-addition>
-
-      <!-- Possible missing parentheses. -->
-      <warn-unlikely-function-value>true</warn-unlikely-function-value>
-
-      <!-- Possible usage of the ActionScript 2.0 XML class. -->
-      <warn-xml-class-has-changed>false</warn-xml-class-has-changed>
-
-   </compiler>
-
-   <!-- compute-digest: writes a digest to the catalog.xml of a library. Use this when the library will be used as a
-                        cross-domain rsl.-->
-   <!-- compute-digest usage:
-   <compute-digest>boolean</compute-digest>
-   -->
-
-   <!-- A list of runtime shared library URLs to be loaded before applications start. -->
-   <!-- not set -->
-   <!--
-   <runtime-shared-libraries>
-      <url>string</url>
-      <url>string</url>
-   </runtime-shared-libraries>
-   -->
-
-   <!-- runtime-shared-library-path: specifies a SWC or directory to link against and an RSL URL to load with optional failover URLs -->
-   <runtime-shared-library-path>
-      <path-element>/opt/flex-sdk-3/frameworks/libs/framework.swc</path-element>
-      <rsl-url>framework_3.2.0.3958.swz</rsl-url>
-      <policy-file-url></policy-file-url>
-      <rsl-url>framework_3.2.0.3958.swf</rsl-url>
-      <policy-file-url></policy-file-url>
-   </runtime-shared-library-path>
-   <!-- static-link-runtime-shared-libraries: statically link the libraries specified by the -runtime-shared-libraries-path option.-->
-   <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
-
-   <!-- target-player: specifies the version of the player the application is targeting.
-                       Features requiring a later version will not be compiled into the application.
-                       The minimum value supported is "9.0.0".-->
-   <!-- target-player usage:
-   <target-player>version</target-player>
-   -->
-
-   <!-- Enables SWFs to access the network. -->
-   <use-network>true</use-network>
-
-   <!-- Metadata added to SWFs via the SWF Metadata tag. -->
-   <metadata>
-      <title>Adobe Flex 3 Application</title>
-      <description>http://www.adobe.com/products/flex</description>
-      <publisher>unknown</publisher>
-      <creator>unknown</creator>
-      <language>EN</language>
-   </metadata>
-
-   <!-- licenses: specifies a list of product and serial number pairs.
-   <licenses>
-      <license>
-         <product></product>
-         <serial-number></serial-number>
-      </license>
-   </licenses>
-   -->
-
-</flex-config>

From misa@rpath.com Tue Jun 30 21:51:26 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n611pQJU028927
	for <xobj-commits@lists.rpath.com>; Wed, 1 Jul 2009 01:51:26 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n611pQag009521
	for <xobj-commits@lists.rpath.com>; Tue, 30 Jun 2009 21:51:26 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id n611p8EU030069
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 30 Jun 2009 21:51:08 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n611pPYe031370
	for <xobj-commits@lists.rpath.com>; Wed, 1 Jul 2009 01:51:25 GMT
Received: (from misa@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n611pO0r031365
	for xobj-commits@lists.rpath.com; Wed, 1 Jul 2009 01:51:24 GMT
From: Mihai Ibanescu <misa@rpath.com>
Message-Id: <200907010151.n611pO0r031365@scc.eng.rpath.com>
Date: Wed, 01 Jul 2009 01:51:24 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Old lxml escapes unicode in attributes, 2.2.0 converts to utf-8
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 01 Jul 2009 01:51:26 -0000

tag:         tip
user:        Mihai Ibanescu <https://issues.rpath.com/>
files:       py/test/xobjtest.py test/complex.xml

Old lxml escapes unicode in attributes, 2.2.0 converts to utf-8

diff -r 08bc3627a2fc -r 215d992c1cbf py/test/xobjtest.py
--- a/py/test/xobjtest.py	Thu Jun 25 13:42:32 2009 -0400
+++ b/py/test/xobjtest.py	Tue Jun 30 21:50:54 2009 -0400
@@ -815,9 +815,13 @@
         # Good: char string (unicode) for text and attribute
         s.top.foo = u'\xf6'
         s.top.bar = u'\xf6'
+        if etree.__version__ >= "2.2.0":
+            attr = "\xc3\xb6"
+        else:
+            attr = "&#xF6;"
         self.assertEquals(s.toxml(),
                 '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
-                '<top bar="\xc3\xb6">\n  <foo>\xc3\xb6</foo>\n</top>\n')
+                '<top bar="%s">\n  <foo>\xc3\xb6</foo>\n</top>\n' % attr)
 
 
     def testLong(self):
diff -r 08bc3627a2fc -r 215d992c1cbf test/complex.xml
--- a/test/complex.xml	Thu Jun 25 13:42:32 2009 -0400
+++ b/test/complex.xml	Tue Jun 30 21:50:54 2009 -0400
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='UTF-8'?>
-<top >
+<top>
   <prop>
     <subprop subattr="1">asdf</subprop>
     <subprop subattr="2">fdsa</subprop>

From bpja@rpath.com Mon Jul 13 23:35:36 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n6E3ZaoA023397
	for <xobj-commits@lists.rpath.com>; Tue, 14 Jul 2009 03:35:36 GMT
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n6E3ZZ87010740
	for <xobj-commits@lists.rpath.com>; Mon, 13 Jul 2009 23:35:36 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id n6E3ZXAu013384
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 13 Jul 2009 23:35:33 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n6E3ZZSx003732
	for <xobj-commits@lists.rpath.com>; Tue, 14 Jul 2009 03:35:35 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n6E3ZZ7f003728
	for xobj-commits@lists.rpath.com; Tue, 14 Jul 2009 03:35:35 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <200907140335.n6E3ZZ7f003728@scc.eng.rpath.com>
Date: Tue, 14 Jul 2009 03:35:35 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Branch merge from 5.2
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 14 Jul 2009 03:35:36 -0000

tag:         tip
user:        Brett Adam
files:       as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as

Branch merge from 5.2

diff -r 8de90b490fc6 -r 4f64a72036c7 as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Wed Jul 08 10:39:40 2009 -0400
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as	Mon Jul 13 23:35:26 2009 -0400
@@ -122,7 +122,7 @@
      * 
      * This method is marked public so that the ComplexString type can use it
      */
-    public static function simpleType(val:Object):Object
+    public static function simpleType(val:Object, resultType:Class=null):Object
     {
         var result:Object = val;
 
@@ -134,8 +134,9 @@
             
             //return the value as a string, a boolean or a number.
             //numbers that start with 0 are left as strings
-            //bForceObject removed since we'll take care of converting to a String or Number object later
-            if (val is String && String(val) == "")
+            //ForceObject removed since we'll take care of converting to a String or Number object later
+            // make sure to check if String here so "1.0" is a String, not the number 1 (RBL-4931)
+            if ((val is String) && ((String(val) == "") || (resultType == String)))
             {
                 result = valStr;    
             }
@@ -147,6 +148,14 @@
             {
                 result = false;
             }
+            else if (resultType == int)
+            {
+                result = Number(val);
+            }
+            else if (resultType == Number)
+            {
+                result = Number(val);
+            }
             else if (!isFinite(testNum) || isNaN(testNum)
                 || (val.charAt(0) == '0') // starts with a leading zero
                 || ((val.charAt(0) == '-') && (val.charAt(1) == '0')) // starts with -0
@@ -365,7 +374,7 @@
         {
             nullObject = false;
 
-            var temp:* = XObjXMLDecoder.simpleType(children[0].nodeValue);
+            var temp:* = XObjXMLDecoder.simpleType(children[0].nodeValue, resultType);
             if (!isSpecifiedType || 
                 (result is String) || (resultTypeName == "com.rpath.xobj.XObjString") || (result is int) || (result is Number) || (result is Boolean))
             {
@@ -529,7 +538,7 @@
 
             var attrName:String = attrObj.propname;
 
-            var attr:* = XObjXMLDecoder.simpleType(attributes[attribute]);
+            var attr:* = XObjXMLDecoder.simpleType(attributes[attribute], resultType);
             
             if (makeAttributesMeta)
             {

From brector@rpath.com Wed Oct 28 14:28:27 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n9SISRr0003999
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 14:28:27 -0400
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n9SISR9R005787
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 14:28:27 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id n9SISQEV021171
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 14:28:26 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n9SITtV7003676
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 18:29:55 GMT
Received: (from brector@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n9SITtAp003661
	for xobj-commits@lists.rpath.com; Wed, 28 Oct 2009 18:29:55 GMT
From: brector@rpath.com
Message-Id: <200910281829.n9SITtAp003661@scc.eng.rpath.com>
Date: Wed, 28 Oct 2009 18:29:54 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: added bool type to accepted primatives (RBL-5167)
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 28 Oct 2009 18:28:27 -0000

changeset:   44a8283ea403
user:        Ben Rector <brector@rpath.com>
date:        Mon, 26 Oct 2009 18:50:11 +0000

added bool type to accepted primatives (RBL-5167)

diff --git a/py/xobj/xobj.py b/py/xobj/xobj.py
--- a/py/xobj/xobj.py
+++ b/py/xobj/xobj.py
@@ -177,7 +177,7 @@
 
         tag = addns(tag)
 
-        if type(xobj) in (int, long, float):
+        if type(xobj) in (int, long, float, bool):
             xobj = unicode(xobj)
 
         if type(xobj) == str:
@@ -248,7 +248,7 @@
                         l.append(val)
 
         orderedElements = []
-
+        
         if hasattr(xobj, '_xobj'):
             for name in xobj._xobj.elements:
                 for val in elements.get(name, []):

From brector@rpath.com Wed Oct 28 14:33:22 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n9SIXMvj004031
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 14:33:22 -0400
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n9SIXLcg005905
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 14:33:21 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id n9SIXLvx021458
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 14:33:21 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n9SIYnL1003778
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 18:34:49 GMT
Received: (from brector@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n9SIYmx5003774
	for xobj-commits@lists.rpath.com; Wed, 28 Oct 2009 18:34:48 GMT
From: brector@rpath.com
Message-Id: <200910281834.n9SIYmx5003774@scc.eng.rpath.com>
Date: Wed, 28 Oct 2009 18:34:48 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Added tag xobj-1.0 for changeset a34f9d6de981
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 28 Oct 2009 18:33:22 -0000

changeset:   24220c63f07c
user:        Ben Rector <brector@rpath.com>
date:        Wed, 28 Oct 2009 18:32:30 +0000

Added tag xobj-1.0 for changeset a34f9d6de981

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -6,3 +6,4 @@
 4a05f0f015c4fcd52fed071c51b936240639cadb rba-5.2.1
 2bb36bf913df0b998683f37ebb451c9b2d996995 rba-5.2.2
 03869cb7e411decd7d9f072284302b39a9a3f7fe rba-5.2.3
+a34f9d6de9814e9ce41727a54466ab8d7e0a91b0 xobj-1.0

From brector@rpath.com Wed Oct 28 14:43:03 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	n9SIh3e0004061
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 14:43:03 -0400
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id n9SIh2QJ006487
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 14:43:03 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id n9SIh26c022000
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 14:43:02 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id n9SIiUdt003980
	for <xobj-commits@lists.rpath.com>; Wed, 28 Oct 2009 18:44:30 GMT
Received: (from brector@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id n9SIiUDp003976
	for xobj-commits@lists.rpath.com; Wed, 28 Oct 2009 18:44:30 GMT
From: brector@rpath.com
Message-Id: <200910281844.n9SIiUDp003976@scc.eng.rpath.com>
Date: Wed, 28 Oct 2009 18:44:30 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Added New NEWS section
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 28 Oct 2009 18:43:03 -0000

changeset:   f2c5a43ad86f
user:        Ben Rector <brector@rpath.com>
date:        Wed, 28 Oct 2009 18:35:18 +0000

Added New NEWS section

diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+Changes in @NEW@:
+
 Changes in 1.0:
   * Initial public release.
 

From mtharp@rpath.com Wed Dec  9 13:42:27 2009
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	nB9IgR8g026931
	for <xobj-commits@lists.rpath.com>; Wed, 9 Dec 2009 13:42:27 -0500
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id nB9IgRAg018543
	for <xobj-commits@lists.rpath.com>; Wed, 9 Dec 2009 13:42:27 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id nB9IgRDR028162
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 9 Dec 2009 13:42:27 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id nB9IgQaQ001357
	for <xobj-commits@lists.rpath.com>; Wed, 9 Dec 2009 18:42:26 GMT
Received: (from mtharp@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id nB9IgQw2001353
	for xobj-commits@lists.rpath.com; Wed, 9 Dec 2009 18:42:26 GMT
From: Michael Tharp <mtharp@rpath.com>
Message-Id: <200912091842.nB9IgQw2001353@scc.eng.rpath.com>
Date: Wed, 09 Dec 2009 18:42:26 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Fixed the re-definition of the model after bad XML is fed
	in (RBL-5328)
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 09 Dec 2009 18:42:27 -0000

changeset:   37f11b32cb54
user:        Mihai Ibanescu <https://issues.rpath.com/>
date:        Fri, 06 Nov 2009 10:45:21 -0500

Fixed the re-definition of the model after bad XML is fed in (RBL-5328)

diff --git a/py/test/xobjtest.py b/py/test/xobjtest.py
--- a/py/test/xobjtest.py
+++ b/py/test/xobjtest.py
@@ -834,5 +834,36 @@
         x = xobj.parse(s, typeMap = { 'foo' : Foo })
         assert(x.foo.i == 1 << 33)
 
+    def testGlobalsPoisoning(self):
+        # RBL-5328
+        class Foo(object):
+            _xobj = xobj.XObjMetadata(attributes = [ ],
+                elements = [ 'elem1', 'elem2' ])
+
+        f = Foo()
+        f.elem1 = 'val1'
+        f.elem2 = 'val2'
+        s = xobj.toxml(f, 'root')
+        self.assertXMLEquals(s,
+            "<root><elem1>val1</elem1><elem2>val2</elem2></root>")
+
+        # Now feed it an XML string that uses attributes instead of elements
+        x = xobj.parse('<root elem1="val1" elem2="val2" />',
+            typeMap = { 'root' : Foo })
+        self.failUnlessEqual(x.root.elem1, f.elem1)
+        self.failUnlessEqual(x.root.elem2, f.elem2)
+
+        # Now serialize f again, elements should continue to be elements
+        s = xobj.toxml(f, 'root')
+        self.assertXMLEquals(s,
+            "<root><elem1>val1</elem1><elem2>val2</elem2></root>")
+
+        # Brand new object
+        f2 = Foo()
+        f2.elem1 = 'val2'
+        s2 = xobj.toxml(f2, 'root')
+        self.assertXMLEquals(s2,
+            "<root><elem1>val2</elem1></root>")
+
 if __name__ == "__main__":
     testsuite.main()
diff --git a/py/xobj/xobj.py b/py/xobj/xobj.py
--- a/py/xobj/xobj.py
+++ b/py/xobj/xobj.py
@@ -387,13 +387,18 @@
 
         def addAttribute(xobj, key, val, xType = None):
             setItem(xobj, key, val, xType)
-            if key not in xobj._xobj.attributes:
-                # preserver any type information we copied in
+            if key not in xobj._xobj.attributes and (key not in
+                                                    xobj._xobj.elements):
+                # preserve any type information we copied in, but only if it
+                # wasn't previously defined (either element or attribute).
                 xobj._xobj.attributes[key] = None
 
         def addElement(xobj, key, val, xType = None):
             setItem(xobj, key, val, xType = xType)
-            if key not in xobj._xobj.elements:
+            if key not in xobj._xobj.elements and (key not in
+                                                    xobj._xobj.attributes):
+                # preserve any type information we copied in, but only if it
+                # wasn't previously defined (either element or attribute).
                 xobj._xobj.elements.append(key)
 
         def setItem(xobj, key, val, xType = None):

From bpja@rpath.com Sun Feb 21 23:53:43 2010
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	o1M4rhos003329
	for <xobj-commits@lists.rpath.com>; Sun, 21 Feb 2010 23:53:43 -0500
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id o1M4rgBo029455
	for <xobj-commits@lists.rpath.com>; Sun, 21 Feb 2010 23:53:43 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id o1M4rgGu026689
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Sun, 21 Feb 2010 23:53:42 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id o1M4rg1q006954
	for <xobj-commits@lists.rpath.com>; Mon, 22 Feb 2010 04:53:42 GMT
Received: (from bpja@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id o1M4rg7t006950
	for xobj-commits@lists.rpath.com; Mon, 22 Feb 2010 04:53:42 GMT
From: Brett Adam <bpja@rpath.com>
Message-Id: <201002220453.o1M4rg7t006950@scc.eng.rpath.com>
Date: Mon, 22 Feb 2010 04:53:42 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: FlashBuilder project prefs. Marker file. Should probably
	remove from hg
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 22 Feb 2010 04:53:43 -0000

changeset:   d94f5334fa3d
user:        Brett Adam
date:        Sun, 21 Feb 2010 23:53:39 -0500

FlashBuilder project prefs. Marker file. Should probably remove from hg

diff --git a/as3/xobjas3/.settings/com.adobe.flexbuilder.project.prefs b/as3/xobjas3/.settings/com.adobe.flexbuilder.project.prefs
new file mode 100644
--- /dev/null
+++ b/as3/xobjas3/.settings/com.adobe.flexbuilder.project.prefs
@@ -0,0 +1,3 @@
+#Fri Feb 19 09:41:45 EST 2010
+eclipse.preferences.version=1
+upgradeSDK/fb4=

From agrimm@rpath.com Wed Mar 10 13:39:29 2010
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	o2AIdTJg010869
	for <xobj-commits@lists.rpath.com>; Wed, 10 Mar 2010 13:39:29 -0500
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id o2AIdTam010085
	for <xobj-commits@lists.rpath.com>; Wed, 10 Mar 2010 13:39:29 -0500
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id o2AIdSLh027532
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 10 Mar 2010 13:39:28 -0500
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id o2AIdSVB016171
	for <xobj-commits@lists.rpath.com>; Wed, 10 Mar 2010 18:39:28 GMT
Received: (from agrimm@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id o2AIdSd1016167
	for xobj-commits@lists.rpath.com; Wed, 10 Mar 2010 18:39:28 GMT
From: agrimm@rpath.com
Message-Id: <201003101839.o2AIdSd1016167@scc.eng.rpath.com>
Date: Wed, 10 Mar 2010 18:39:28 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Make it easier to build python components only
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 10 Mar 2010 18:39:29 -0000

changeset:   9db171e844b3
user:        Andy Grimm <https://issues.rpath.com/>
date:        Wed, 10 Mar 2010 13:39:26 -0500

Make it easier to build python components only

diff --git a/Make.rules b/Make.rules
--- a/Make.rules
+++ b/Make.rules
@@ -12,7 +12,7 @@
 
 .SILENT:
 
-export TOPDIR
+export TOPDIR PYONLY
 
 # Default rules
 default-build: subdirs-build
@@ -75,15 +75,21 @@
 
 # Actionscript rules
 as-build:
+ifndef PYONLY
 	ANT_OPTS=$(antopts) ant build
+endif
 
 as-install:
 
 as-clean:
+ifndef PYONLY
 	ANT_OPTS=$(antopts) ant clean
+endif
 
 as-test:
+ifndef PYONLY
 	ANT_OPTS=$(antopts) ant test
+endif
 
 
 # testutils rules

From elliot@rpath.com Fri Jun  4 13:25:32 2010
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	o54HPWHX023873
	for <xobj-commits@lists.rpath.com>; Fri, 4 Jun 2010 13:25:32 -0400
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id o54HPWhw003352
	for <xobj-commits@lists.rpath.com>; Fri, 4 Jun 2010 13:25:32 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id o54HPWOV018524
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 4 Jun 2010 13:25:32 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id o54HPWmD026626
	for <xobj-commits@lists.rpath.com>; Fri, 4 Jun 2010 17:25:32 GMT
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id o54HPWX4026622
	for xobj-commits@lists.rpath.com; Fri, 4 Jun 2010 17:25:32 GMT
From: Elliot Peele <elliot@rpath.com>
Message-Id: <201006041725.o54HPWX4026622@scc.eng.rpath.com>
Date: Fri, 04 Jun 2010 17:25:32 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: add handling for default values in model objects (PFM-705)
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailman-Approved-At: Mon, 07 Jun 2010 11:08:06 -0400
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 04 Jun 2010 17:25:33 -0000

changeset:   050270d9f2e7
user:        Elliot Peele <https://issues.rpath.com/>
date:        Fri, 04 Jun 2010 13:25:29 -0400

add handling for default values in model objects (PFM-705)

diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
 Changes in @NEW@:
+  * Added handling for default values. (PFM-705)
 
 Changes in 1.0:
   * Initial public release.
diff --git a/py/test/xobjtest.py b/py/test/xobjtest.py
--- a/py/test/xobjtest.py
+++ b/py/test/xobjtest.py
@@ -865,5 +865,48 @@
         self.assertXMLEquals(s2,
             "<root><elem1>val2</elem1></root>")
 
+    def testDefaultValuesSimple(self):
+        class Foo(object):
+            i = int
+            def __init__(self, i=0):
+                self.i = i
+        class Doc(xobj.Document):
+            foo = Foo
+
+        xml = '<foo><i>1</i></foo>'
+
+        doc = xobj.parse(xml, documentClass=Doc)
+        self.failUnless(issubclass(type(doc.foo.i), Foo.i))
+
+        xml2 = '<foo><i>1</i><i>2</i></foo>'
+
+        doc2 = xobj.parse(xml2, documentClass=Doc)
+        self.failUnless(issubclass(type(doc2.foo.i), Foo.i))
+        self.failUnlessEqual(doc2.foo.i, 2)
+
+    def testDefaultValuesComplex(self):
+        class Foo(object):
+            i = int
+            def __init__(self, i=0):
+                self.i = i
+            def __repr__(self):
+                return 'Foo(%s)' % self.i
+            def __cmp__(self, other):
+                return cmp(self.i, other.i)
+        class Bar(object):
+            j = [ Foo ]
+            def __init__(self):
+                self.j = [ Foo(0), Foo(1), Foo(2), ]
+        class BarDoc(xobj.Document):
+            bar = Bar
+
+        xml2 = '<bar><j><i>3</i></j><j><i>4</i></j></bar>'
+
+        doc2 = xobj.parse(xml2, documentClass=BarDoc)
+        self.failUnless(issubclass(type(doc2.bar.j), type(Bar.j)))
+        self.failIfEqual(len(doc2.bar.j), len(Bar().j))
+        self.failUnlessEqual(doc2.bar.j, [Foo(3), Foo(4)])
+
+
 if __name__ == "__main__":
     testsuite.main()
diff --git a/py/xobj/xobj.py b/py/xobj/xobj.py
--- a/py/xobj/xobj.py
+++ b/py/xobj/xobj.py
@@ -403,12 +403,18 @@
 
         def setItem(xobj, key, val, xType = None):
             current = getattr(xobj, key, None)
-            if xType and xType.forceList:
-                # force the item to be a list, and use the type inside of
-                # this list as the type of elements of the list
-                if key not in xobj.__dict__:
-                    current = []
+            if xType:
+                if xType.forceList:
+                    # force the item to be a list, and use the type inside of
+                    # this list as the type of elements of the list
+                    if key not in xobj.__dict__:
+                        current = []
                     setattr(xobj, key, current)
+                # Avoid turning things into lists that are not defined as lists
+                # in the type map.
+                elif not isinstance(xobj, XObj):
+                    setattr(xobj, key, val)
+                    return
 
             if xobj.__dict__.get(key, None) is None:
                 # This has not yet been set in the instance (because it's
@@ -489,11 +495,23 @@
             if not hasattr(xobj, '_xobj'):
                 xobj._xobj = XObjMetadata()
 
+            initialized = set()
+
             # handle children
             for childElement in element.getchildren():
                 if types.BuiltinFunctionType == type(childElement.tag):
                     # this catches comments. this is ugly.
                     continue
+
+                # Initialize values that are defined to be lists in the type
+                # map. This overrides any default values from instantiating the
+                # instance.
+                if childElement.tag not in initialized:
+                    attr = getattr(xobj, childElement.tag, None)
+                    if attr and isinstance(attr, list):
+                        setattr(xobj, childElement.tag, list())
+                    initialized.add(childElement.tag)
+
                 child = parseElement(childElement, parentXType = thisXType,
                                      parentXObj = xobj,
                                      parentUnionTags = unionTags)

From elliot@rpath.com Tue Sep  7 13:01:27 2010
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	o87H1R7u032439
	for <xobj-commits@lists.rpath.com>; Tue, 7 Sep 2010 13:01:27 -0400
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id o87H1RNS004282
	for <xobj-commits@lists.rpath.com>; Tue, 7 Sep 2010 13:01:27 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id o87H1ROo026059
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Tue, 7 Sep 2010 13:01:27 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id o87H1QHl000372
	for <xobj-commits@lists.rpath.com>; Tue, 7 Sep 2010 17:01:26 GMT
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id o87H1QmJ000368
	for xobj-commits@lists.rpath.com; Tue, 7 Sep 2010 17:01:26 GMT
From: Elliot Peele <elliot@rpath.com>
Message-Id: <201009071701.o87H1QmJ000368@scc.eng.rpath.com>
Date: Tue, 07 Sep 2010 17:01:26 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: make sure simple collections with attributes continue to
 work
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Tue, 07 Sep 2010 17:01:28 -0000

changeset:   2f047aaf578e
user:        Elliot Peele <https://issues.rpath.com/>
date:        Tue, 07 Sep 2010 13:01:23 -0400

make sure simple collections with attributes continue to work

diff --git a/py/test/xobjtest.py b/py/test/xobjtest.py
--- a/py/test/xobjtest.py
+++ b/py/test/xobjtest.py
@@ -907,6 +907,38 @@
         self.failIfEqual(len(doc2.bar.j), len(Bar().j))
         self.failUnlessEqual(doc2.bar.j, [Foo(3), Foo(4)])
 
+    def testCollectionWithAttrs(self):
+        class Foo(object):
+            bar = str
+            _xobj = xobj.XObjMetadata(attributes=('id', ))
+        class Foos(object):
+            foo = [ Foo, ]
+            _xobj = xobj.XObjMetadata(attributes=('id', ))
+        class Doc(xobj.Document):
+            foos = Foos
+
+        xml = """\
+<?xml version='1.0' encoding='UTF-8'?>
+<foos id="/api/foos">
+    <foo id="/api/foos/1">
+        <bar>a</bar>
+    </foo>
+    <foo id="/api/foos/2">
+        <bar>b</bar>
+    </foo>
+</foos>
+"""
+
+        doc = xobj.parse(xml, documentClass=Doc)
+
+        self.failUnlessEqual(len(doc.foos.foo), 2)
+        self.failUnlessEqual(doc.foos.foo[0].bar, 'a')
+        self.failUnlessEqual(doc.foos.foo[1].bar, 'b')
+
+        xml2 = doc.toxml()
+
+        self.assertXMLEquals(xml, xml2)
+
 
 if __name__ == "__main__":
     testsuite.main()

From elliot@rpath.com Mon Sep 13 16:02:39 2010
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	o8DK2dqD005782
	for <xobj-commits@lists.rpath.com>; Mon, 13 Sep 2010 16:02:39 -0400
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id o8DK2cfP014354
	for <xobj-commits@lists.rpath.com>; Mon, 13 Sep 2010 16:02:38 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id o8DK2csL026664
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Mon, 13 Sep 2010 16:02:38 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id o8DK2cxX032525
	for <xobj-commits@lists.rpath.com>; Mon, 13 Sep 2010 20:02:38 GMT
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id o8DK2cSm032521
	for xobj-commits@lists.rpath.com; Mon, 13 Sep 2010 20:02:38 GMT
From: Elliot Peele <elliot@rpath.com>
Message-Id: <201009132002.o8DK2cSm032521@scc.eng.rpath.com>
Date: Mon, 13 Sep 2010 20:02:38 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Make sure tag values are consistently stored as part of the
	xobj metadata
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Mon, 13 Sep 2010 20:02:39 -0000

changeset:   28ee98fb3297
user:        Elliot Peele <https://issues.rpath.com/>
date:        Mon, 13 Sep 2010 16:02:36 -0400

Make sure tag values are consistently stored as part of the xobj metadata

diff --git a/py/test/xobjtest.py b/py/test/xobjtest.py
--- a/py/test/xobjtest.py
+++ b/py/test/xobjtest.py
@@ -939,6 +939,33 @@
 
         self.assertXMLEquals(xml, xml2)
 
+    def testSettingTag(self):
+        class Foo(object):
+            _xobj = xobj.XObjMetadata(tag='foo', attributes='href')
+            href = str
+        class Doc(xobj.Document):
+            foo = Foo
+
+        xml = """\
+<?xml version='1.0' encoding='UTF-8'?>
+<foo href="http://example.com/api/" />
+"""
+
+        doc = xobj.parse(xml, documentClass=Doc)
+        self.failUnlessEqual(doc.foo._xobj.tag, 'foo')
+
+        doc2 = xobj.parse(xml)
+        self.failUnlessEqual(doc2.foo._xobj.tag, 'foo')
+
+        foo = Foo()
+        foo.href = 'http://example.com/api/'
+        xml2 = xobj.toxml(foo)
+
+        self.assertXMLEquals(xml, xml2)
+
+        doc.foo._xobj.tag = None
+        self.failUnlessRaises(TypeError, xobj.toxml, doc.foo)
+
 
 if __name__ == "__main__":
     testsuite.main()
diff --git a/py/xobj/xobj.py b/py/xobj/xobj.py
--- a/py/xobj/xobj.py
+++ b/py/xobj/xobj.py
@@ -495,6 +495,9 @@
             if not hasattr(xobj, '_xobj'):
                 xobj._xobj = XObjMetadata()
 
+            if not xobj._xobj.tag:
+                xobj._xobj.tag = tag
+
             initialized = set()
 
             # handle children
@@ -615,13 +618,16 @@
     s = StringIO(s)
     return parsef(s, schemaf, documentClass = documentClass, typeMap = typeMap)
 
-def toxml(xobj, tag, prettyPrint = True, xml_declaration = True,
+def toxml(xobj, tag = None, prettyPrint = True, xml_declaration = True,
           schemaf = None, nsmap = {}):
     if schemaf:
         schemaObj = etree.XMLSchema(file = schemaf)
     else:
         schemaObj = None
 
+    if tag is None and hasattr(xobj, '_xobj') and xobj._xobj.tag is None:
+        raise TypeError, 'must specify a tag'
+
     gen = ElementGenerator(xobj, tag, schema = schemaObj, nsmap = nsmap)
 
     return gen.tostring(prettyPrint = prettyPrint,

From elliot@rpath.com Wed Oct 20 16:19:00 2010
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	o9KKIxow010346
	for <xobj-commits@lists.rpath.com>; Wed, 20 Oct 2010 16:18:59 -0400
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id o9KKIxuE020658
	for <xobj-commits@lists.rpath.com>; Wed, 20 Oct 2010 16:18:59 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id o9KKIx2H028692
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Wed, 20 Oct 2010 16:18:59 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id o9KKIxN6016042
	for <xobj-commits@lists.rpath.com>; Wed, 20 Oct 2010 20:18:59 GMT
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id o9KKIxbH016038
	for xobj-commits@lists.rpath.com; Wed, 20 Oct 2010 20:18:59 GMT
From: Elliot Peele <elliot@rpath.com>
Message-Id: <201010202018.o9KKIxbH016038@scc.eng.rpath.com>
Date: Wed, 20 Oct 2010 20:18:59 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: add test to enforce behaviour of nested collections
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Wed, 20 Oct 2010 20:19:00 -0000

changeset:   2051a8128c6a
user:        Elliot Peele <https://issues.rpath.com/>
date:        Wed, 20 Oct 2010 16:18:55 -0400

add test to enforce behaviour of nested collections

diff --git a/py/test/xobjtest.py b/py/test/xobjtest.py
--- a/py/test/xobjtest.py
+++ b/py/test/xobjtest.py
@@ -966,6 +966,60 @@
         doc.foo._xobj.tag = None
         self.failUnlessRaises(TypeError, xobj.toxml, doc.foo)
 
+    def testNestedLists(self):
+        xml = """\
+<?xml version='1.0' encoding='UTF-8'?>
+<msis>
+  <msi>
+    <name>Setup</name>
+    <files>
+      <file>foo.exe</file>
+      <file>bar.exe</file>
+    </files>
+  </msi>
+  <msi>
+    <name>Setup2</name>
+    <files>
+      <file>
+        <name>foo.exe</name>
+        <uuid>12345</uuid>
+      </file>
+      <file>
+        <name>bar.exe</name>
+        <uuid>23456</uuid>
+      </file>
+    </files>
+  </msi>
+</msis>
+"""
+
+        doc = xobj.parse(xml)
+
+        self.failUnless(hasattr(doc, 'msis'))
+        self.failUnless(hasattr(doc.msis, 'msi'))
+        self.failUnless(isinstance(doc.msis.msi, list))
+        self.failUnlessEqual(len(doc.msis.msi), 2)
+
+        msi0 = doc.msis.msi[0]
+
+        self.failUnlessEqual(msi0.name, 'Setup')
+        self.failUnless(hasattr(msi0, 'files'))
+        self.failUnless(hasattr(msi0.files, 'file'))
+        self.failUnless(isinstance(msi0.files.file, list))
+        self.failUnlessEqual(len(msi0.files.file), 2)
+
+        msi1 = doc.msis.msi[1]
+
+        self.failUnlessEqual(msi1.name, 'Setup2')
+        self.failUnless(hasattr(msi1, 'files'))
+        self.failUnless(hasattr(msi1.files, 'file'))
+        self.failUnless(isinstance(msi1.files.file, list))
+        self.failUnlessEqual(len(msi1.files.file), 2)
+        self.failUnlessEqual(msi1.files.file[0].name, 'foo.exe')
+        self.failUnlessEqual(msi1.files.file[0].uuid, '12345')
+        self.failUnlessEqual(msi1.files.file[1].name, 'bar.exe')
+        self.failUnlessEqual(msi1.files.file[1].uuid, '23456')
+
 
 if __name__ == "__main__":
     testsuite.main()

From elliot@rpath.com Fri Mar 25 11:03:09 2011
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	p2PF39NS025172
	for <xobj-commits@lists.rpath.com>; Fri, 25 Mar 2011 11:03:09 -0400
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id p2PF38Re012215
	for <xobj-commits@lists.rpath.com>; Fri, 25 Mar 2011 11:03:08 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id p2PF38P4000708
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Fri, 25 Mar 2011 11:03:08 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id p2PF388d015125
	for <xobj-commits@lists.rpath.com>; Fri, 25 Mar 2011 15:03:08 GMT
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id p2PF384i015121
	for xobj-commits@lists.rpath.com; Fri, 25 Mar 2011 15:03:08 GMT
From: Elliot Peele <elliot@rpath.com>
Message-Id: <201103251503.p2PF384i015121@scc.eng.rpath.com>
Date: Fri, 25 Mar 2011 15:03:08 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: don't try to use instance methods as python types
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Fri, 25 Mar 2011 15:03:09 -0000

changeset:   20be7d80a305
user:        Elliot Peele <https://issues.rpath.com/>
date:        Fri, 25 Mar 2011 11:03:06 -0400

don't try to use instance methods as python types

diff --git a/py/xobj/xobj.py b/py/xobj/xobj.py
--- a/py/xobj/xobj.py
+++ b/py/xobj/xobj.py
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2008-2009 rPath, Inc.
+# Copyright (c) 2008-2011 rPath, Inc.
 #
 # This program is distributed under the terms of the MIT License as found 
 # in a file called LICENSE. If it is not present, the license
@@ -9,9 +9,11 @@
 # without any waranty; without even the implied warranty of merchantability
 # or fitness for a particular purpose. See the MIT License for full details.
 
+import types
+import inspect
+from StringIO import StringIO
+
 from lxml import etree
-import types
-from StringIO import StringIO
 
 DocumentInvalid = etree.DocumentInvalid
 
@@ -150,9 +152,12 @@
 
     pass
 
+def isMethod(func):
+    return inspect.ismethod(func) or inspect.ismethoddescriptor(func)
+
 def findPythonType(xobj, key):
     pc = getattr(xobj.__class__, key, None)
-    if pc is not None:
+    if pc is not None and not isMethod(pc):
         return pc
 
     md = getattr(xobj.__class__, '_xobj', None)

From elliot@rpath.com Thu Apr 14 11:33:39 2011
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	p3EFXdDg011634
	for <xobj-commits@lists.rpath.com>; Thu, 14 Apr 2011 11:33:39 -0400
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id p3EFXcKT017777
	for <xobj-commits@lists.rpath.com>; Thu, 14 Apr 2011 11:33:38 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id p3EFXctO000955
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 14 Apr 2011 11:33:38 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id p3EFXckm011610
	for <xobj-commits@lists.rpath.com>; Thu, 14 Apr 2011 15:33:38 GMT
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id p3EFXcRN011605
	for xobj-commits@lists.rpath.com; Thu, 14 Apr 2011 15:33:38 GMT
From: Elliot Peele <elliot@rpath.com>
Message-Id: <201104141533.p3EFXcRN011605@scc.eng.rpath.com>
Date: Thu, 14 Apr 2011 15:33:38 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Allow for more generalized ICollectionView handling not
	just ArrayCollection handling
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 14 Apr 2011 15:33:39 -0000

changeset:   6a4a738de013
user:        Brett Adam
date:        Mon, 24 May 2010 17:04:44 -0400

Allow for more generalized ICollectionView handling not just ArrayCollection handling

diff --git a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
@@ -19,9 +19,12 @@
     import flash.xml.XMLNode;
     
     import mx.collections.ArrayCollection;
+    import mx.collections.ArrayList;
+    import mx.collections.ICollectionView;
     import mx.utils.DescribeTypeCache;
     import mx.utils.ObjectProxy;
     import mx.utils.object_proxy;
+
     use namespace object_proxy;
     
     public class XObjUtils
@@ -137,11 +140,11 @@
             {
                 // TODO: better way to detect an arry subclass?
                 var foo:* = new type();
-                result = (foo is Array);
+                result = (foo is Array || foo is ArrayList || foo is Vector);
                 arrayTypeCache[type] = result;
 
                 // do the array collection test while we're here, to save time
-                arrayCollectionTypeCache[type] = (foo is ArrayCollection) || (foo is IXObjCollection);
+                arrayCollectionTypeCache[type] = (foo is ICollectionView) || (foo is IXObjCollection);
             }
             return result;
         }
@@ -161,7 +164,7 @@
             {
                 // TODO: better way to detect an arry subclass?
                 var foo:* = new type();
-                result = (foo is ArrayCollection) || (foo is IXObjCollection);
+                result = (foo is ICollectionView) || (foo is IXObjCollection);
                 arrayCollectionTypeCache[type] = result;
 
                 // do the array test while we're here, to save time
diff --git a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
@@ -53,6 +53,7 @@
 import flash.xml.XMLNodeType;
 
 import mx.collections.ArrayCollection;
+import mx.collections.ICollectionView;
 import mx.rpc.xml.*;
 import mx.utils.ObjectProxy;
 
@@ -485,7 +486,7 @@
                         var existing:* = result[partName];
                         if (existing && (existing is Object)
                             && !((existing is Array) 
-                                || (existing is ArrayCollection)
+                                || (existing is ICollectionView)
                                 || (existing is String)
                                 || (existing is Boolean)
                                 || (existing is Number)

From elliot@rpath.com Thu Apr 14 11:33:43 2011
Received: from mx2.rpath.com (proxy1.eqx-dc2-be.rpath.com [172.16.180.40])
	by lists-app.eqx-dc2-be.rpath.com (8.13.7/8.13.7) with ESMTP id
	p3EFXhQD011640
	for <xobj-commits@lists.rpath.com>; Thu, 14 Apr 2011 11:33:43 -0400
Received: from rdu-nat.rpath.com (rdu-nat.rpath.com [66.192.95.194])
	by mx2.rpath.com (8.13.7/8.13.7) with ESMTP id p3EFXhM0017783
	for <xobj-commits@lists.rpath.com>; Thu, 14 Apr 2011 11:33:43 -0400
Received: from scc.eng.rpath.com (scc.eng.rpath.com [172.16.160.77])
	by rdu-nat.rpath.com (8.14.2/8.14.2) with ESMTP id p3EFXhli000963
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <xobj-commits@lists.rpath.com>; Thu, 14 Apr 2011 11:33:43 -0400
Received: from scc.eng.rpath.com (localhost.localdomain [127.0.0.1])
	by scc.eng.rpath.com (8.14.2/8.14.2) with ESMTP id p3EFXhYb013049
	for <xobj-commits@lists.rpath.com>; Thu, 14 Apr 2011 15:33:43 GMT
Received: (from elliot@localhost)
	by scc.eng.rpath.com (8.14.2/8.14.2/Submit) id p3EFXhut013044
	for xobj-commits@lists.rpath.com; Thu, 14 Apr 2011 15:33:43 GMT
From: Elliot Peele <elliot@rpath.com>
Message-Id: <201104141533.p3EFXhut013044@scc.eng.rpath.com>
Date: Thu, 14 Apr 2011 15:33:43 +0000
To: xobj-commits@lists.rpath.com
Subject: xobj: Branch merge
User-Agent: Heirloom mailx 12.3 7/15/07
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-BeenThere: xobj-commits@lists.rpath.com
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <xobj-commits.lists.rpath.com>
List-Unsubscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=unsubscribe>
List-Archive: <http://lists.rpath.com/pipermail/xobj-commits>
List-Help: <mailto:xobj-commits-request@lists.rpath.com?subject=help>
List-Subscribe: <http://lists.rpath.com/mailman/listinfo/xobj-commits>,
	<mailto:xobj-commits-request@lists.rpath.com?subject=subscribe>
X-List-Received-Date: Thu, 14 Apr 2011 15:33:43 -0000

changeset:   842fd3aa97f2
user:        Brad Murphy <https://issues.rpath.com>
date:        Fri, 10 Dec 2010 05:12:53 +0000

Branch merge

diff --git a/as3/xobjas3/.actionScriptProperties b/as3/xobjas3/.actionScriptProperties
--- a/as3/xobjas3/.actionScriptProperties
+++ b/as3/xobjas3/.actionScriptProperties
@@ -2,7 +2,7 @@
 <actionScriptProperties analytics="false" mainApplicationPath="xobjas3.as" projectUUID="6260d2b2-b348-40a2-87e7-958f53558f88" version="6">
   <compiler additionalCompilerArguments="-keep-as3-metadata+=ArrayElementType,xobjTransient" autoRSLOrdering="true" copyDependentFiles="false" flex3CompatMode="false" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
     <compilerSourcePath/>
-    <libraryPath defaultLinkType="0">
+    <libraryPath defaultLinkType="1">
       <libraryPathEntry kind="4" path="">
         <excludedEntries>
           <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
diff --git a/as3/xobjas3/.flexLibProperties b/as3/xobjas3/.flexLibProperties
--- a/as3/xobjas3/.flexLibProperties
+++ b/as3/xobjas3/.flexLibProperties
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<flexLibProperties includeAllClasses="true" version="1">
+<flexLibProperties includeAllClasses="false" version="1">
   <includeClasses>
     <classEntry path="com.rpath.xobj.FilterTerm"/>
     <classEntry path="com.rpath.xobj.IInvalidationAware"/>
@@ -19,6 +19,7 @@
     <classEntry path="com.rpath.xobj.XObjXMLEncoder"/>
     <classEntry path="com.rpath.xobj.XSmartURL"/>
     <classEntry path="com.rpath.xobj.XSmartURLDescriptor"/>
+    <classEntry path="com.rpath.xobj.IXObjHref"/>
   </includeClasses>
   <includeResources/>
   <namespaceManifests>
diff --git a/as3/xobjas3/src/com/rpath/xobj/IXObjCollection.as b/as3/xobjas3/src/com/rpath/xobj/IXObjCollection.as
--- a/as3/xobjas3/src/com/rpath/xobj/IXObjCollection.as
+++ b/as3/xobjas3/src/com/rpath/xobj/IXObjCollection.as
@@ -9,6 +9,8 @@
     function addItem(value:Object):void;
     function addItemIfAbsent(value:Object):Boolean;
     function removeItemIfPresent(object:Object):Boolean;
+    
+    function isElementMember(propname:String):Boolean;
 }
 
 }
\ No newline at end of file
diff --git a/as3/xobjas3/src/com/rpath/xobj/IXObjHref.as b/as3/xobjas3/src/com/rpath/xobj/IXObjHref.as
new file mode 100644
--- /dev/null
+++ b/as3/xobjas3/src/com/rpath/xobj/IXObjHref.as
@@ -0,0 +1,7 @@
+package com.rpath.xobj
+{
+public interface IXObjHref
+{
+    // marker interface
+}
+}
\ No newline at end of file
diff --git a/as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as b/as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjTypeInfo.as
@@ -23,7 +23,8 @@
         public var typeName:String;
         public var isArray:Boolean;
         public var isCollection:Boolean;
-
+        public var isMember:Boolean;
+        
         public var arrayElementTypeName:String;
         public var arrayElementClass:Class;
     }
diff --git a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjUtils.as
@@ -13,6 +13,7 @@
 
 package com.rpath.xobj
 {
+    import flash.errors.StackOverflowError;
     import flash.utils.Dictionary;
     import flash.utils.getDefinitionByName;
     import flash.utils.getQualifiedClassName;
@@ -21,12 +22,10 @@
     import mx.collections.ArrayCollection;
     import mx.collections.ArrayList;
     import mx.collections.ICollectionView;
+    import mx.collections.IList;
     import mx.utils.DescribeTypeCache;
     import mx.utils.ObjectProxy;
     import mx.utils.object_proxy;
-    import mx.collections.IList;
-
-    import flash.errors.StackOverflowError;
 
     use namespace object_proxy;
     
@@ -272,6 +271,13 @@
                 {
                     typeInfo.type = XObjUtils.getClassByName(typeInfo.typeName);
                 }
+    
+                // ask if this is a member of not
+                if (object is IXObjCollection)
+                {
+                    typeInfo.isMember = (object as IXObjCollection).isElementMember(propName);
+                }
+
                 // cache the result for next time
                 typePropertyCache[propertyCacheKey] = typeInfo;
             }
diff --git a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
--- a/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
+++ b/as3/xobjas3/src/com/rpath/xobj/XObjXMLDecoder.as
@@ -489,7 +489,7 @@
                     propertyName = elementName;
                     propertyIsArray = false;
                     propertyIsCollection = false;
-
+                    
                     // record the order we see the elements in for encoding purposes
                     // this is an attempt to "fake" XMLSchema sequence constraint of
                     // ordered elements. Collapse sequenced repetitions to a single entry
@@ -517,6 +517,7 @@
                     partClassName = typeInfo.typeName;
                     propertyIsArray = typeInfo.isArray;
                     propertyIsCollection = typeInfo.isCollection;
+                    isMember = typeInfo.isMember;
                     
                     // make sure we can pass on an [ArrayElementType()] metadata
                     // we observe on this property (which will not be visible
@@ -530,8 +531,8 @@
                         partObj = rootObject;
                         partClass = XObjUtils.getClass(partObj);
                         partClassName = XObjUtils.getClassName(partObj);
-                        propertyIsArray = XObjUtils.isTypeArray(partClass);
-                        propertyIsCollection = XObjUtils.isTypeCollection(partClass);
+                        //propertyIsArray = XObjUtils.isTypeArray(partClass);
+                        //propertyIsCollection = XObjUtils.isTypeCollection(partClass);
                     }
                     // else should we reuse an existing property object?
                     else if (result.hasOwnProperty(propertyName))
@@ -578,6 +579,16 @@
                                 partObj = existing;
                             }
                         }
+                        else
+                        {
+                            // we have the property, but no value
+                            if (!partClass)
+                            {
+                                // must be plain old Object, but our TypeInfo
+                                // method ignores them...compensate
+                                partClass = Object;
+                            }
+                        }
                     }
 
                     
@@ -591,39 +602,17 @@
                     // assigned to the property, not made a member of the 
                     // collection)
 
-                    isMember = false;
-
                     if (!partObj && !partClass)
                     {
-                        // important: are we *in* an array or collection object?
+                        // important: are we *in* an generic array or collection object?
                         
-                        if (isArray || isCollection)
+                        if (!(result is IXObjCollection)
+                            && (isArray || isCollection))
                         {
                             // we need to handle collection type objects with special care
                             // since if the element doesn't map to a property, it's a member
                             
                             isMember = true;
-
-                            // we were told what type to use on the way in?
-                            if (memberClass)  
-                            {
-                                // parent object determined type for us. let it trump
-                                partClass = memberClass;
-                            }
-                            
-                            if (!partClass)
-                            {
-                                // if we're an xobj ref, it's supposed to be able to tell
-                                // us what types to use for members
-                                var xobjRef:IXObjReference = result as IXObjReference;
-                                
-                                // XObjRefs can tell us their desired member types
-                                if (xobjRef)
-                                {
-                                    // ask the IXObjReference for the type it wants to use
-                                    partClass = xobjRef.elementTypeForElementName(elementName);
-                                }
-                            }
                         }
                         else
                         {
@@ -631,6 +620,31 @@
                         }
                     }
                     
+                    if (isMember)
+                    {
+                        // we were told what type to use on the way in?
+                        if (memberClass)  
+                        {
+                            // parent object determined type for us. let it trump
+                            partClass = memberClass;
+                        }
+                        
+                    }
+                    
+                    if (!partClass)
+                    {
+                        // if we're an xobj ref, it's supposed to be able to tell
+                        // us what types to use for members
+                        var xobjRef:IXObjReference = result as IXObjReference;
+                        
+                        // XObjRefs can tell us their desired member types
+                        if (xobjRef)
+                        {
+                            // ask the IXObjReference for the type it wants to use
+                            partClass = xobjRef.elementTypeForElementName(elementName);
+                        }
+                    }
+
                     if (!partClass)
                     {
                         // if we still don't know, fall all the way back to global
@@ -810,10 +824,20 @@
                         //result.setPropertyIsEnumerable(attrName, false);
                     }
                 }
+                catch (e:TypeError)
+                {
+                    if ((result[attrName] is IXObjHref)
+                        && (attr is String))
+                    {
+                        result[attrName].id = attr;
+                    }
+                    else 
+                        throw e;
+                }
                 catch (e:Error)
                 {
                     //throw new Error("Failed to set attribute "+attrName+"("+attr+") on "+resultTypeName+". Check that class is dynamic or attribute name is spelled correctly");
-                    trace("Failed to set attribute "+attrName+"("+attr+") on "+resultTypeName+". Check that class is dynamic or attribute name is spelled correctly");
+                    trace("Failed to set attribute "+attrName+"("+attr+") on "+resultTypeName+". " + e + ". Check that class is dynamic or attribute name is spelled correctly");
                 }
             }
             
@@ -875,9 +899,6 @@
         return result;
     }
 
-    import flash.utils.flash_proxy;
-    
-    
     private function assignToProperty(result:*, propName:String, value:*,
         seenBefore:Boolean, makeArray:Boolean, makeCollection:Boolean, makeBindable:Boolean):*
     {
diff --git a/as3/xobjas3/src/com/rpath/xobj/XSmartURL.as b/as3/xobjas3/src/com/rpath/xobj/XSmartURL.as
--- a/as3/xobjas3/src/com/rpath/xobj/XSmartURL.as
+++ b/as3/xobjas3/src/com/rpath/xobj/XSmartURL.as
@@ -17,6 +17,7 @@
 import flash.utils.Dictionary;
 import mx.collections.SortField;
 
+[Bindable]
 public class XSmartURL extends URL
 {
     public function XSmartURL(s:*=null)
@@ -35,7 +36,6 @@
     }
     
 
-
     public function get baseURL():URL
     {
         return _baseURL;
@@ -72,12 +72,37 @@
     
     [xobjTransient]
     public var rangeRequest:Boolean;
+    
     [xobjTransient]
-    public var startIndex:Number;
+    private var _startIndex:Number;
+    
+    public function get startIndex():Number
+    {
+        return _startIndex;
+    }
+    
+    public function set startIndex(value:Number):void
+    {
+        _startIndex = value;
+        rangeRequest = true;
+        recomputeQualifiedURL();
+    }
+
     [xobjTransient]
-    public var limit:Number;
-    [xobjTransient]
-    public var rangeUsingHeaders:Boolean;
+    private var _limit:Number;
+
+    public function get limit():Number
+    {
+        return _limit;
+    }
+    
+    public function set limit(value:Number):void
+    {
+        _limit = value;
+        rangeRequest = true;
+        recomputeQualifiedURL();
+    }
+    
     
     /** filterTerms is an array of (field, operator, value) clauses
      * that are assumed to be AND clauses
@@ -140,7 +165,6 @@
     
     // TODO: optimize this via setter/getter pairs on query terms
     [xobjTransient]
-    [Bindable]
     public function get qualifiedURL():String
     {
         return _qualifiedURL;
@@ -166,13 +190,13 @@
         
         if (queryFrag)
         {
-            if (baseURL.hasQuery())
+            if (fullURL.indexOf(descriptor.paramDelimiter) != -1)
             {
-                fullURL = fullURL + "&" + queryFrag;
+                fullURL = fullURL + descriptor.paramDelimiter + queryFrag;
             }
             else
             {
-                fullURL = fullURL + "?" + queryFrag;
+                fullURL = fullURL + descriptor.paramMarker + queryFrag;
             }
         }
         
@@ -191,18 +215,10 @@
         
         if (rangeRequest)
         {
-            if (descriptor.rangeUsingHeaders)
-            {
-                // DAMN HTTPService won't pass RANGE header
-                setHeader("X-Range", "rows "+startIndex+"-"+(startIndex+ limit -1));
-            }
-            else
-            {
-                if (descriptor.startKey)
-                    params[descriptor.startKey] = startIndex;
-                if (descriptor.limitKey)
-                    params[descriptor.limitKey] = limit;
-            }
+            if (descriptor.startKey)
+                params[descriptor.startKey] = startIndex;
+            if (descriptor.limitKey)
+                params[descriptor.limitKey] = limit;
         }
         
         // TODO: use descriptor to tell us how to express sort
@@ -263,7 +279,7 @@
         first = true;
         for (var param:String in params)
         {
-            query = query + (first ? "" : "&") + param + "=" + params[param];
+            query = query + (first ? "" : descriptor.paramDelimiter) + param + "=" + params[param];
             first = false;
         }
         
diff --git a/as3/xobjas3/src/com/rpath/xobj/XSmartURLDescriptor.as b/as3/xobjas3/src/com/rpath/xobj/XSmartURLDescriptor.as
--- a/as3/xobjas3/src/com/rpath/xobj/XSmartURLDescriptor.as
+++ b/as3/xobjas3/src/com/rpath/xobj/XSmartURLDescriptor.as
@@ -12,6 +12,8 @@
 */
 package com.rpath.xobj
 {
+
+[Bindable]
 public class XSmartURLDescriptor
 {
     public function XSmartURLDescriptor()
@@ -20,14 +22,16 @@
     }
     
     // keys used in constructing URLs
-    public var startKey:String = "start";
+    public var paramMarker:String = ":";
+    public var paramDelimiter:String = ";";
+    
+    public var startKey:String = "start_index";
     public var limitKey:String = "limit";
     
     public var sortKey:String = "order_by";
     public var sortConjunction:String = ",";
     public var sortDescMarker:String = "-";
     public var sortAscMarker:String = "";
-    public var rangeUsingHeaders:Boolean = false;
     
     public var filterKey:String = "filter_by";
     public var filterTermStart:String = "[";


