1.1xml文档结构

document ::= prolog?,element+,Misc*
prolog
prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))

Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
S ::= (#x20 | #x9 | #xD | #xA)+
PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
<![CDATA[ " and end with the string " ]]>

Misc ::= Comment | PI | S

doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>'
ExternalID ::= 'SYstem' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral

<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE greeting SYstem "hello.dtd"> <greeting>Hello,world!</greeting>

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念