Finding Node Types : Comments and Processing Instructions : XML Flash / Flex / ActionScript examples


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

 

Finding Node Types


 

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.body.nodeKind())// Displays: element
        trace(example.body.@id.nodeKind())// Displays: attribute
        trace(example.body.text().nodeKind())// Displays: text
        trace(example.body.comments()[0].nodeKind())// Displays: comment
        trace(example.body.processingInstructions().nodeKind())// Displays:

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo XML
» Comments and Processing Instructions