use the comments() method or the processingInstructions() method to get XMLLists : Comments and Processing Instructions : XML Flash / Flex / ActionScript examples


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

 

use the comments() method or the processingInstructions() method to get XMLLists


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        XML.ignoreComments = false;
        XML.ignoreProcessingInstructions = false;
        var example:XML = <html>
                                  <head />
                                  <body id="main">
                                     Welcome!
                                     <!-- Start PHP -->
                                        <?php
                                           // execute some php code
                                        ?>
                                     <!-- End PHP -->
                                  </body>
                               </html>;
        trace(example.*.comments().length())// Displays: 2
        trace(example.body.comments().toXMLString());
        trace(example.body.comments()[1].toXMLString());
        trace(example.*.processingInstructions().toXMLString());


    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo XML
» Comments and Processing Instructions