Converting Comments and Processing-Instructions to Strings : Comments and Processing Instructions « XML « Flash / Flex / ActionScript

Home
Flash / Flex / ActionScript
1.Animation
2.Array
3.Class
4.Data Type
5.Development
6.Function
7.Graphics
8.Language
9.Network
10.Regular Expressions
11.Statement
12.String
13.TextField
14.XML
Flash / Flex / ActionScript » XML » Comments and Processing Instructions 
Converting Comments and Processing-Instructions to Strings
 


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


        XML.ignoreComments = false;
        XML.ignoreProcessingInstructions = false;
        
        var novel:XML = <BOOK ISBN="0141182806">
        <!--This is a comment-->
            <?someTargetApp someData?>
            <TITLE>Actionscript</TITLE>
            <AUTHOR>J, K</AUTHOR>
            <PUBLISHER>Penguin Books Ltd</PUBLISHER>
          </BOOK>;
        
        trace(novel.comments()[0].toString(  ));
        
        trace(novel.processingInstructions()[0].toString(  ));
        

    }
  }
}

        
Related examples in the same category
1.Accessing Comments and Processing Instructions
2.To obtain an XMLList representing all comments and processing instructions within an entire XML tree
3.Search for elements only while ignoring text nodes, comments, and processing directives, use elements()
4.Finding Node Types: element, attribute, text, comment, processing-instruction
5.use the comments() method or the processingInstructions() method to get XMLLists
6.Setting Options for the XML Class
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.