Accessing Comments and Processing Instructions : Comments and Processing Instructions : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » Comments and Processing Instructions »

 

Accessing Comments and Processing Instructions


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var novel:XML = <BOOK ISBN="0000000000">
            <!--Hello world-->
            <?application someData?>
            <TITLE>ActionScript</TITLE>
            <AUTHOR>J, J</AUTHOR>
            <?app2 someData?>
            <PUBLISHER>Books Ltd</PUBLISHER>
            <!--The End-->
          </BOOK>
        
        novel.ignoreComments = false;
        novel.ignoreProcessingInstructions = false;
        
        trace(novel.comments(  )[0]);                // <!--Hello world-->
        trace(novel.comments(  )[1]);                // <!--Goodbye world-->
        trace(novel.processingInstructions(  )[0]);  // <?app1 someData?>
        trace(novel.processingInstructions(  )[1]);  // <?app2 someData?>

    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo XML
» Comments and Processing Instructions