Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are a couple ways to do this, but the best way is to use a namespace prefix before each dot access. In your case the first thing you want to do is to isolate the namespace. You can do this by hard coding the namespace into a new namespace object... ie;</p> <pre><code>var ns:Namespace = new Namespace( "http://www.sitcom-project.org/sitcom" ); </code></pre> <p>Or a better way is to just extract it from the appropriate node. In the following code I am getting all the namespaces (as an array) declared on the type node, and just targeting the first one in the list. Because I don't know the namespace beforehand, I have to retrieve it using the children() method.</p> <pre><code>var emNode:XML = _yourXML.em[0]; var typeRoot:XML = emNode.children()[0]; var ns:Namespace = typeRoot.namespaceDeclarations()[0]; </code></pre> <p>Once you have accomplished this, you can use namespace syntax to dig into your model.</p> <pre><code>var impWith:String = typeRoot.ns::model.ns::implemented_with; </code></pre> <p>This can be a little verbose, so you can set the default namespace using the following syntax. I don't like this personally, but it does work.</p> <pre><code>default xml namespace = ns; var impWith:String = typeRoot.model.implemented_with; default xml namespace = null; </code></pre> <p>A simple one-liner could be.</p> <pre><code>var ns:Namespace = new Namespace("http://www.sitcom-project.org/sitcom"); var imp:String = _yourXML.em[0].ns::type.ns::model.ns::implemented_with; </code></pre> <p>Using the default syntax</p> <pre><code>default xml namespace = new Namespace("http://www.sitcom-project.org/sitcom"); var imp:String = _yourXML.em[0].type.model.implemented_with; default xml namespace = null; </code></pre> <p>Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload