TOP / Contents / Previous / Next / Index
HEAD要素、BODY 要素に含めることができます。
(文書内で)SCRIPT を使うときは HEAD 内に次のような宣言が必要だとW3Cは言っています。
type が必須(#REQUIRED)になっていることに注意してください(例: type="text/javascript")。
<!-- script statements, which may include CDATA sections --> <!ELEMENT script (#PCDATA)> <!ATTLIST script id ID #IMPLIED charset %Charset; #IMPLIED type %ContentType; #REQUIRED src %URI; #IMPLIED defer (defer) #IMPLIED xml:space (preserve) #FIXED 'preserve' >
<!ELEMENT SCRIPT - - %Script; -- script statements --> <!ATTLIST SCRIPT charset %Charset; #IMPLIED -- char encoding of linked resource -- type %ContentType; #REQUIRED -- content type of script language -- src %URI; #IMPLIED -- URI for an external script -- defer (defer) #IMPLIED -- UA may defer execution of script -- event CDATA #IMPLIED -- reserved for possible future use -- for %URI; #IMPLIED -- reserved for possible future use -- >
<!-- script statements, which may include CDATA sections --> <!ELEMENT script (#PCDATA)> <!ATTLIST script id ID #IMPLIED charset %Charset; #IMPLIED type %ContentType; #REQUIRED language CDATA #IMPLIED src %URI; #IMPLIED defer (defer) #IMPLIED xml:space (preserve) #FIXED 'preserve' >
<!ELEMENT SCRIPT - - %Script; -- script statements --> <!ATTLIST SCRIPT charset %Charset; #IMPLIED -- char encoding of linked resource -- type %ContentType; #REQUIRED -- content type of script language -- language CDATA #IMPLIED -- predefined script language name -- src %URI; #IMPLIED -- URI for an external script -- defer (defer) #IMPLIED -- UA may defer execution of script -- event CDATA #IMPLIED -- reserved for possible future use -- for %URI; #IMPLIED -- reserved for possible future use -- >
<!-- SCRIPT/STYLE are place holders for transition to next version of HTML --> <!ELEMENT SCRIPT - - CDATA -- placeholder for script statements -->
HEAD要素に含めることはできません。SCRIPT に対応していない場合や対応していても その機能を使えない場合、ユーザが使わないように設定している場合等に表示されます。
<!ENTITY % heading "h1|h2|h3|h4|h5|h6"> <!ENTITY % lists "ul | ol | dl"> <!ENTITY % blocktext "pre | hr | blockquote | address"> <!ENTITY % block "p | %heading; | div | %lists; | %blocktext; | fieldset | table"> <!ENTITY % Block "(%block; | form | %misc;)*"> <!ENTITY % misc.inline "ins | del | script"> <!ENTITY % misc "noscript | %misc.inline;"> <!ELEMENT noscript %Block;> <!ATTLIST noscript %attrs; >
<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
<!ENTITY % list "UL | OL">
<!ENTITY % preformatted "PRE">
<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
<!ELEMENT NOSCRIPT - - (%block;)+
-- alternate content container for non script-based rendering -->
<!ATTLIST NOSCRIPT
%attrs; -- %coreattrs, %i18n, %events --
>
<!ELEMENT noscript %Flow;> <!ATTLIST noscript %attrs; >
<!ELEMENT noscript %Flow;> <!ATTLIST noscript %attrs; >
<!ENTITY % fontstyle "TT | I | B | U | S | STRIKE | BIG | SMALL">
<!ENTITY % phrase "EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
<!ENTITY % special
"A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
MAP | Q | SUB | SUP | SPAN | BDO | IFRAME">
<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
<!ENTITY % list "UL | OL | DIR | MENU">
<!ENTITY % preformatted "PRE">
<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | CENTER | NOSCRIPT |
NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR | TABLE | FIELDSET | ADDRESS">
<!ENTITY % flow "%block; | %inline;">
<!ELEMENT NOSCRIPT - - (%flow;)+
-- alternate content container for non script-based rendering -->
<!ATTLIST NOSCRIPT
%attrs; -- %coreattrs, %i18n, %events --
>
HEAD要素に含まれる OBJECT 要素は、表示されません。w3cの解説文書には、Frameset を利用する際に、共有するファイルの定義付けに利用する例が載っています。
BODY要素では、image/gif, jpeg といったものから、movie/mpeg, javaapplet 等を表示するのに使われるようです。
また、OBJECT要素の内容は、当該OBJECTが表示(実行)できない場合の代替OBJECTや表示になります。
OBJECTに対して、初期パラメータ値を与えるPARAM要素は(置くなら)内容の先頭(開始タグの直後)に置くべきだとコメントがあります。
<!ENTITY % heading "h1|h2|h3|h4|h5|h6"> <!ENTITY % lists "ul | ol | dl"> <!ENTITY % blocktext "pre | hr | blockquote | address"> <!ENTITY % block "p | %heading; | div | %lists; | %blocktext; | fieldset | table"> <!ENTITY % special.pre "br | span | bdo | map"> <!ENTITY % special "%special.pre; | object | img "> <!ENTITY % fontstyle "tt | i | b | big | small "> <!ENTITY % phrase "em | strong | dfn | code | q | samp | kbd | var | cite | abbr | acronym | sub | sup "> <!ENTITY % inline.forms "input | select | textarea | label | button"> <!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"> <!ENTITY % misc.inline "ins | del | script"> <!ENTITY % misc "noscript | %misc.inline;"> <!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*> <!ATTLIST object %attrs; declare (declare) #IMPLIED classid %URI; #IMPLIED codebase %URI; #IMPLIED data %URI; #IMPLIED type %ContentType; #IMPLIED codetype %ContentType; #IMPLIED archive %UriList; #IMPLIED standby %Text; #IMPLIED height %Length; #IMPLIED width %Length; #IMPLIED usemap %URI; #IMPLIED name NMTOKEN #IMPLIED tabindex %Number; #IMPLIED >
<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
<!ENTITY % list "UL | OL">
<!ENTITY % preformatted "PRE">
<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
<!ENTITY % fontstyle "TT | I | B | BIG | SMALL">
<!ENTITY % phrase "EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM">
<!ENTITY % special "A | IMG | OBJECT | BR | SCRIPT | MAP | Q | SUB | SUP | SPAN | BDO">
<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
<!ENTITY % flow "%block; | %inline;">
<!ELEMENT OBJECT - - (PARAM | %flow;)* -- generic embedded object -->
<!ATTLIST OBJECT
%attrs; -- %coreattrs, %i18n, %events --
declare (declare) #IMPLIED -- declare but don't instantiate flag --
classid %URI; #IMPLIED -- identifies an implementation --
codebase %URI; #IMPLIED -- base URI for classid, data, archive--
data %URI; #IMPLIED -- reference to object's data --
type %ContentType; #IMPLIED -- content type for data --
codetype %ContentType; #IMPLIED -- content type for code --
archive CDATA #IMPLIED -- space separated archive list --
standby %Text; #IMPLIED -- message to show while loading --
height %Length; #IMPLIED -- override height --
width %Length; #IMPLIED -- override width --
usemap %URI; #IMPLIED -- use client-side image map --
name CDATA #IMPLIED -- submit as part of form --
tabindex NUMBER #IMPLIED -- position in tabbing order --
%reserved; -- reserved for possible future use --
>
<!ENTITY % heading "h1|h2|h3|h4|h5|h6"> <!ENTITY % lists "ul | ol | dl | menu | dir"> <!ENTITY % blocktext "pre | hr | blockquote | address | center | noframes"> <!ENTITY % block "p | %heading; | div | %lists; | %blocktext; | isindex | fieldset | table"> <!ENTITY % special.extra "object | applet | img | map | iframe"> <!ENTITY % special.basic "br | span | bdo"> <!ENTITY % special "%special.basic; | %special.extra;"> <!ENTITY % fontstyle.extra "big | small | font | basefont"> <!ENTITY % fontstyle.basic "tt | i | b | u | s | strike "> <!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;"> <!ENTITY % phrase.extra "sub | sup"> <!ENTITY % phrase.basic "em | strong | dfn | code | q | samp | kbd | var | cite | abbr | acronym"> <!ENTITY % phrase "%phrase.basic; | %phrase.extra;"> <!ENTITY % inline.forms "input | select | textarea | label | button"> <!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"> <!ENTITY % misc.inline "ins | del | script"> <!ENTITY % misc "noscript | %misc.inline;"> <!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*> <!ATTLIST object %attrs; declare (declare) #IMPLIED classid %URI; #IMPLIED codebase %URI; #IMPLIED data %URI; #IMPLIED type %ContentType; #IMPLIED codetype %ContentType; #IMPLIED archive %UriList; #IMPLIED standby %Text; #IMPLIED height %Length; #IMPLIED width %Length; #IMPLIED usemap %URI; #IMPLIED name NMTOKEN #IMPLIED tabindex %Number; #IMPLIED align %ImgAlign; #IMPLIED border %Pixels; #IMPLIED hspace %Pixels; #IMPLIED vspace %Pixels; #IMPLIED >
<!ENTITY % heading "h1|h2|h3|h4|h5|h6"> <!ENTITY % lists "ul | ol | dl | menu | dir"> <!ENTITY % blocktext "pre | hr | blockquote | address | center"> <!ENTITY % block "p | %heading; | div | %lists; | %blocktext; | isindex | fieldset | table"> <!ENTITY % special.extra "object | applet | img | map | iframe"> <!ENTITY % special.basic "br | span | bdo"> <!ENTITY % special "%special.basic; | %special.extra;"> <!ENTITY % fontstyle.extra "big | small | font | basefont"> <!ENTITY % fontstyle.basic "tt | i | b | u | s | strike "> <!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;"> <!ENTITY % phrase.extra "sub | sup"> <!ENTITY % phrase.basic "em | strong | dfn | code | q | samp | kbd | var | cite | abbr | acronym"> <!ENTITY % phrase "%phrase.basic; | %phrase.extra;"> <!ENTITY % inline.forms "input | select | textarea | label | button"> <!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"> <!ENTITY % misc.inline "ins | del | script"> <!ENTITY % misc "noscript | %misc.inline;"> <!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*> <!ATTLIST object %attrs; declare (declare) #IMPLIED classid %URI; #IMPLIED codebase %URI; #IMPLIED data %URI; #IMPLIED type %ContentType; #IMPLIED codetype %ContentType; #IMPLIED archive %UriList; #IMPLIED standby %Text; #IMPLIED height %Length; #IMPLIED width %Length; #IMPLIED usemap %URI; #IMPLIED name NMTOKEN #IMPLIED tabindex %Number; #IMPLIED align %ImgAlign; #IMPLIED border %Pixels; #IMPLIED hspace %Pixels; #IMPLIED vspace %Pixels; #IMPLIED >
<!ENTITY % fontstyle "TT | I | B | U | S | STRIKE | BIG | SMALL">
<!ENTITY % phrase "EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
<!ENTITY % special
"A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
MAP | Q | SUB | SUP | SPAN | BDO | IFRAME">
<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
<!ENTITY % list "UL | OL | DIR | MENU">
<!ENTITY % preformatted "PRE">
<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | CENTER | NOSCRIPT |
NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR | TABLE | FIELDSET | ADDRESS">
<!ENTITY % flow "%block; | %inline;">
<!ELEMENT OBJECT - - (PARAM | %flow;)* -- generic embedded object -->
<!ATTLIST OBJECT
%attrs; -- %coreattrs, %i18n, %events --
declare (declare) #IMPLIED -- declare but don't instantiate flag --
classid %URI; #IMPLIED -- identifies an implementation --
codebase %URI; #IMPLIED -- base URI for classid, data, archive--
data %URI; #IMPLIED -- reference to object's data --
type %ContentType; #IMPLIED -- content type for data --
codetype %ContentType; #IMPLIED -- content type for code --
archive CDATA #IMPLIED -- space separated archive list --
standby %Text; #IMPLIED -- message to show while loading --
height %Length; #IMPLIED -- override height --
width %Length; #IMPLIED -- override width --
usemap %URI; #IMPLIED -- use client-side image map --
name CDATA #IMPLIED -- submit as part of form --
tabindex NUMBER #IMPLIED -- position in tabbing order --
align %IAlign; #IMPLIED -- vertical or horizontal alignment --
border %Length; #IMPLIED -- link border width --
hspace %Pixels; #IMPLIED -- horizontal gutter --
vspace %Pixels; #IMPLIED -- vertical gutter --
%reserved; -- reserved for possible future use --
>
OBJECT, APPLET(Except Strict) に対して、初期パラメータ値を与えます。
いずれのバージョンでも、当該要素の先頭(開始タグの直後)に置くべきだとコメントがあります。
name属性がXHTML 1.0 Strictのみ #IMPLIED になっているのは、XMLではname属性ではなくid属性を利用するためだと思われる (当然name属性が使えないわけではない)。
<!ELEMENT param EMPTY> <!ATTLIST param id ID #IMPLIED name CDATA #IMPLIED value CDATA #IMPLIED valuetype (data|ref|object) "data" type %ContentType; #IMPLIED >
<!ELEMENT param EMPTY> <!ATTLIST param id ID #IMPLIED name CDATA #REQUIRED value CDATA #IMPLIED valuetype (data|ref|object) "data" type %ContentType; #IMPLIED >
<!ELEMENT PARAM - O EMPTY -- named property value --> <!ATTLIST PARAM id ID #IMPLIED -- document-wide unique id -- name CDATA #REQUIRED -- property name -- value CDATA #IMPLIED -- property value -- valuetype (DATA|REF|OBJECT) DATA -- How to interpret value -- type %ContentType; #IMPLIED -- content type for value when valuetype=ref -- >
<!ELEMENT PARAM - O EMPTY>
<!ATTLIST PARAM
name NMTOKEN #REQUIRED -- The name of the parameter --
value CDATA #IMPLIED -- The value of the parameter --
>
HEAD要素に含むことはできません。HTML 4 では非推奨となっています。OBJECT 要素を使ってください。
<!ENTITY % heading "h1|h2|h3|h4|h5|h6"> <!ENTITY % lists "ul | ol | dl | menu | dir"> <!ENTITY % blocktext "pre | hr | blockquote | address | center | noframes"> <!ENTITY % block "p | %heading; | div | %lists; | %blocktext; | isindex | fieldset | table"> <!ENTITY % special.extra "object | applet | img | map | iframe"> <!ENTITY % special.basic "br | span | bdo"> <!ENTITY % special "%special.basic; | %special.extra;"> <!ENTITY % fontstyle.extra "big | small | font | basefont"> <!ENTITY % fontstyle.basic "tt | i | b | u | s | strike "> <!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;"> <!ENTITY % phrase.extra "sub | sup"> <!ENTITY % phrase.basic "em | strong | dfn | code | q | samp | kbd | var | cite | abbr | acronym"> <!ENTITY % phrase "%phrase.basic; | %phrase.extra;"> <!ENTITY % inline.forms "input | select | textarea | label | button"> <!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"> <!ENTITY % misc.inline "ins | del | script"> <!ENTITY % misc "noscript | %misc.inline;"> <!ELEMENT applet (#PCDATA | param | %block; | form | %inline; | %misc;)*> <!ATTLIST applet %coreattrs; codebase %URI; #IMPLIED archive CDATA #IMPLIED code CDATA #IMPLIED object CDATA #IMPLIED alt %Text; #IMPLIED name NMTOKEN #IMPLIED width %Length; #REQUIRED height %Length; #REQUIRED align %ImgAlign; #IMPLIED hspace %Pixels; #IMPLIED vspace %Pixels; #IMPLIED >
<!ENTITY % heading "h1|h2|h3|h4|h5|h6"> <!ENTITY % lists "ul | ol | dl | menu | dir"> <!ENTITY % blocktext "pre | hr | blockquote | address | center"> <!ENTITY % block "p | %heading; | div | %lists; | %blocktext; | isindex | fieldset | table"> <!ENTITY % special.extra "object | applet | img | map | iframe"> <!ENTITY % special.basic "br | span | bdo"> <!ENTITY % special "%special.basic; | %special.extra;"> <!ENTITY % fontstyle.extra "big | small | font | basefont"> <!ENTITY % fontstyle.basic "tt | i | b | u | s | strike "> <!ENTITY % fontstyle "%fontstyle.basic; | %fontstyle.extra;"> <!ENTITY % phrase.extra "sub | sup"> <!ENTITY % phrase.basic "em | strong | dfn | code | q | samp | kbd | var | cite | abbr | acronym"> <!ENTITY % phrase "%phrase.basic; | %phrase.extra;"> <!ENTITY % inline.forms "input | select | textarea | label | button"> <!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;"> <!ENTITY % misc.inline "ins | del | script"> <!ENTITY % misc "noscript | %misc.inline;"> <!ELEMENT applet (#PCDATA | param | %block; | form | %inline; | %misc;)*> <!ATTLIST applet %coreattrs; codebase %URI; #IMPLIED archive CDATA #IMPLIED code CDATA #IMPLIED object CDATA #IMPLIED alt %Text; #IMPLIED name NMTOKEN #IMPLIED width %Length; #REQUIRED height %Length; #REQUIRED align %ImgAlign; #IMPLIED hspace %Pixels; #IMPLIED vspace %Pixels; #IMPLIED >
<!--
One of code or object attributes must be present.
Place PARAM elements before other content.
-->
<!ENTITY % fontstyle "TT | I | B | U | S | STRIKE | BIG | SMALL">
<!ENTITY % phrase "EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM" >
<!ENTITY % special
"A | IMG | APPLET | OBJECT | FONT | BASEFONT | BR | SCRIPT |
MAP | Q | SUB | SUP | SPAN | BDO | IFRAME">
<!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
<!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; | %formctrl;">
<!ENTITY % heading "H1|H2|H3|H4|H5|H6">
<!ENTITY % list "UL | OL | DIR | MENU">
<!ENTITY % preformatted "PRE">
<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | CENTER | NOSCRIPT |
NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR | TABLE | FIELDSET | ADDRESS">
<!ENTITY % flow "%block; | %inline;">
<!ELEMENT APPLET - - (PARAM | %flow;)* -- Java applet -->
<!ATTLIST APPLET
%coreattrs; -- id, class, style, title --
codebase %URI; #IMPLIED -- optional base URI for applet --
archive CDATA #IMPLIED -- comma separated archive list --
code CDATA #IMPLIED -- applet class file --
object CDATA #IMPLIED -- serialized applet file --
alt %Text; #IMPLIED -- short description --
name CDATA #IMPLIED -- allows applets to find each other --
width %Length; #REQUIRED -- initial width --
height %Length; #REQUIRED -- initial height --
align %IAlign; #IMPLIED -- vertical or horizontal alignment --
hspace %Pixels; #IMPLIED -- horizontal gutter --
vspace %Pixels; #IMPLIED -- vertical gutter --
>
<!ELEMENT APPLET - - (PARAM | %text)*>
<!ATTLIST APPLET
codebase %URL #IMPLIED -- code base --
code CDATA #REQUIRED -- class file --
alt CDATA #IMPLIED -- for display in place of applet --
name CDATA #IMPLIED -- applet name --
width %Pixels #REQUIRED -- suggested width in pixels --
height %Pixels #REQUIRED -- suggested height in pixels --
align %IAlign #IMPLIED -- vertical or horizontal alignment --
hspace %Pixels #IMPLIED -- suggested horizontal gutter --
vspace %Pixels #IMPLIED -- suggested vertical gutter --
>
Copyright (c) 1999-2000,2002 Yuuichirou Oka
[E-mail] avex-freak@ma1.seikyou.ne.jp
All right reserved. International copyright secured.