tailieunhanh - Học Actionscript 3.0 - p 42
Understanding XML Structure Declarations You will likely see additional tags at the start of XML documents that you should be aware of. The first is the XML declaration tag, and it usually looks something like this: This may differ, depending on the source document, but the purpose of such a tag is usually the same. It tells parsers the version of the XML language specification and the type of encoding used when the file was written. Another example of a declaration tag is the document type declaration (DTD), which is used to identify a set of rules against which a parser will compare. | Understanding XML Structure Declarations You will likely see additional tags at the start of XML documents that you should be aware of. The first is the XML declaration tag and it usually looks something like this xml version encoding UTF-8 This may differ depending on the source document but the purpose of such a tag is usually the same. It tells parsers the version of the XML language specification and the type of encoding used when the file was written. Another example of a declaration tag is the document type declaration DTD which is used to identify a set of rules against which a parser will compare the XML when validating. An example can be seen here DOCTYPE note SYSTEM ActionScript does not validate XML using these declaration tags. If you plan to use an XML document with another parser such as a server-side component of your project with which ActionScript will communicate you may need to use these tags. However ActionScript does not require their presence. Comments and Processing Instructions XML comments use the same form as HTML comments -- comment -- . In ActionScript they are ignored by default but they can be parsed using E4X in the rare case that you may want to use them. For example you may want to track version or date information that wouldn t otherwise appear in the structure of your data. To parse comments you must add the following static property assignment to your script before creating your XML object false Processing instructions are strings typically used when working with style sheets to display XML and ActionScript does not use them. They take the form instruction . They are ignored by default but can also be parsed using E4X and converted to strings if you wish to use them though this too is exceedingly rare. To do so you must add this static proper ty setting to your script before creating your XML object false Entities and the CDATA Tag When writing your XML documents .
đang nạp các trang xem trước