0 Replies Latest reply on Oct 29, 2008 10:50 AM by (Carol_Frampton)

    [svn] 3953: The basic problem is for XML and XMLList, the namespace definitions were not being generated so the compilation reported undefined variables like ns1 , ns2, etc.

    Level 1
      Revision: 3953<br />Author:   cframpto@adobe.com<br />Date:     2008-10-29 11:50:08 -0700 (Wed, 29 Oct 2008)<br /><br />Log Message:<br />-----------<br />The basic problem is for XML and XMLList, the namespace definitions were not being generated so the compilation reported undefined variables like ns1, ns2, etc.  The user had no idea what these were since they were variables generated behind the scenes.<br /><br />1. Pulled the identical copies of PrefixMappings and related methods out to their own class.  This allows them to share the same namespace for variable name generation so that there aren?\226?\128?\153t name collisions if there is more than one xml structure in the document.  Prior to this change each XML object would generate ns1, ns2, etc.<br />2. Changed the velocity template and corresponding implementation generation code to write out namespace variable definitions for the source function of the binding expression was twoWay and to write out the entire set of namespace definitions across all the binding expressions for the bindingExprs function.<br />3. Reversed the map in BindingExpressions to be Map<Integer, String> rather than Map<String, Integer> since Integer is unique across the maps of all the binding expressions so the maps can be combined to get the complete set.  The String (uri) is not unique since multiple binding expressions may contain namespaces with the same uri.<br />4. Fixed XML and XMLList attributes so they work correctly if they?\226?\128?\153re not in the default namespace.<br /><br />QE Notes: consider testing XML/XMLList with various xmlns attributes buried in XML<br />Doc Notes: None<br />Bugs: - SDK-16935<br />Reviewer: Paul<br /><br />Ticket Links:<br />------------<br />    http://bugs.adobe.com/jira/browse/SDK-16935<br /><br />Modified Paths:<br />--------------<br />    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java <br />    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/XMLBuilder.java<br />    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/XMLListBuilder.java< br />    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/gen/ClassDefLib.vm<br />    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/BindingExpression.java<b r />    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java<br /><br />Added Paths:<br />-----------<br />    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/PrefixMapping.java