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






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