Hi. Really need some help here with e4x namespace.
Don’t really like to loop and loop in XML to get my values and there’s e4x great but a bit more complex.
This is my XML.
<?xml version='1.0' encoding='UTF-8'?>
<XMI xmlns:UML2='org.omg.xmi.namespace.UML2' xmlns:UML='org.omg.xmi.namespace.UML' xmi.version='1.5'>
<XMI.content>
<UML:Model xmi.id='TC_UML_758ec78c-d256-4d0f-8f7e-42384e1657bd' isSpecification='false' isRoot='false' isAbstract='false' isLeaf='false'>
<UML:Namespace.ownedElement>
<UML:Primitive xmi.id='TC_UML_43c15682-356c-4417-b1b3-112592101dd0' isRoot='false' isAbstract='false' isLeaf='false' isSpecification='false'>
<UML:ModelElement.namespace>
<UML:Namespace xmi.idref='TC_UML_8452543e-e086-42e9-8d09-787a9056b450'/>
</UML:ModelElement.namespace>
<UML:ModelElement.name>
boolean
</UML:ModelElement.name>
</UML:Primitive>
<UML:Package xmi.id='TC_UML_6bfe7496-8356-47cf-a374-f13c22fe8156' isSpecification='false' isRoot='false' isAbstract='false' isLeaf='false'>
<UML:Namespace.ownedElement>
<UML:Class xmi.id='TC_UML_8452543e-e086-42e9-8d09-787a9056b450' isActive='false' isRoot='false' isAbstract='false' isLeaf='false' visibility='public' isSpecification='false'>
<UML:Classifier.feature>
<UML:Attribute xmi.id='TC_UML_8f1b20eb-7922-452d-ba8c-90c0977dff8e' changeability='changeable' visibility='private' isSpecification='false'>
<UML:StructuralFeature.type>
<UML:Classifier xmi.idref='TC_UML_f69e50e9-8f99-496d-a3ba-7f815a72c8a9'/>
</UML:StructuralFeature.type>
<UML:Feature.owner>
<UML:Class xmi.idref='TC_UML_8452543e-e086-42e9-8d09-787a9056b450'/>
</UML:Feature.owner>
<UML:ModelElement.name>
_guid
</UML:ModelElement.name>
</UML:Attribute>
</UML:Classifier.feature>
<UML:ModelElement.namespace>
<UML:Namespace xmi.idref='TC_UML_6bfe7496-8356-47cf-a374-f13c22fe8156'/>
</UML:ModelElement.namespace>
<UML:ModelElement.name>
GoogleAnalytic
</UML:ModelElement.name>
</UML:Class>
</UML:Namespace.ownedElement>
<UML:ModelElement.namespace>
<UML:Namespace xmi.idref='TC_UML_758ec78c-d256-4d0f-8f7e-42384e1657bd'/>
</UML:ModelElement.namespace>
<UML:ModelElement.name>
com.google.analytic
</UML:ModelElement.name>
</UML:Package>
</UML:Namespace.ownedElement>
</UML:Model>
</XMI.content>
</XMI>
What I’m looking for is to get the values easy and as you can se there’s node names with “.” and namespace.
Been trying for a while and this is what I got so far.
var ns:Namespace = new Namespace("UML","org.omg.xmi.namespace.UML");
var list : XMLList = _data.child("XMI.content")[0].ns::Model;
Don’t understand how to get example the next in depth “<UML:Namespace.ownedElement>”
You can se the complexity and problem if I start to do the old looping thing, for example when I want to compare and find id;s for
UML:Model->UML:Namespace.ownedElement->UML: Package->UML:Namespace.ownedElement->UML:Classifier.feature->UML:Attribute->UML:Classifier->attribute(“xmi.idref”)
UML:Model->UML:Namespace.ownedElement->UML: Primitive->UML:ModelElement.namespace->attribute(“xmi.idref”)
Some e4x guru out there that can help