Sunday, 25 September 2011

Quick Tip: Ignoring XML Namespaces

This is another small follow up to Common Mistakes: XML Namespaces and E4X: sometimes you may wish to completely ignore the namespace information, rather than explicitly traverse it. Consider the following example:

var xml: XML = <root xmlns:space="">
  <node>Hello, world!</node>

It is possible to reference node containing Hello, world! using the following:

var node: XML = xml.*::space.node;

No comments:

Post a Comment