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?>
}
}
}
Related examples in the same category