2 Replies Latest reply on Dec 14, 2008 10:53 PM by

    Problem with accessing XML nodes having namespace

      Hi,
      I have an XML file with following format;

      <graphml version="1.3" xmlns=" http://graphml.graphdrawing.org/xmlns/graphml" xmlns:y=" http://www.yworks.com/xml/graphml" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">

      <graph id="G" edgedefault="directed">

      <data key="d11">
      <y:SharedData>
      <y:Brush name="SolidBrush" color="Black" id="1"/>
      </y:SharedData>
      </data>

      <node id="G:n0">
      <y:Labels>
      <y:Text><![CDATA[Start]]></y:Text>
      </y:Labels>
      </node>

      <node id="G:n1">
      <y:Labels>
      <y:Text><![CDATA[End]]></y:Text>
      </y:Labels>
      </node>

      </graph>

      </graphml>


      I am accessing this file as <mx:XML id="layoutXml" source="tmp.xml" />

      I have debug application and found the layoutXml object contains xml file as it is. Now when i am trying to access any child node of layoutXml, every time i found null. Even statement layoutXml.graph.toXMLString() or layoutXml.graph.toString() returns null.

      I have tryied the following approach as well but did not work,
      var nameSpace:Namespace = new Namespace(" http://www.yworks.com/xml/graphml");
      var str:String = layoutXml.graph.node.(@id =="G:n0").nameSpace::Labels.nameSpace::Text.toXMLString();
      this also returns null.

      If any one having the solution , please reply.

      Thanks.