Here's a small snippet of code that demonstrates the new behaviors:
Code:
break on
$xml = createobject("microsoft.xmldom")
$element = $xml.AppendChild($xml.CreateElement("kixtart"))
$attribute = $element.setattribute("languagetype", "scripting")
?"element=" $element.xml
if $element.attributes
?"the element has attributes"
endif
if $attribute.attributes
?"the attribute has attributes"
endif
exit 0
If you run this with Beta1, we get no syntax errors. Here is the output listing...
Code:
E:\xml>kix32 t
element=<kixtart languagetype="scripting"/>
the element has attributes
This code here is the "iffy" bit:
Code:
if $attribute.attributes
?"the attribute has attributes"
endif
Theoretically, an "attribute" doesn't have attributes. But the old Beta just kinda glosses over it. If you run this with the new Beta, you get the following syntax error ...
Code:
E:\xml>kix32b2 t
element=<kixtart languagetype="scripting"/>
the element has attributes
ERROR : Error in expression.!
Script: t
Line : 15
According to the XMLDOM object model (browsing the typelib), a DOMAttribute does "have" an attributes property (collection) (??!!!) - looking at this property through the old beta, it returns an empty reference. Maybe what is "broken" in the new Beta is the handling of Empty references. Need to drill down more deeply to really figure-out whats going on.
Ruud - can you add anything ?
-Shawn