Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XHTML validation for pages with flash code 1

Status
Not open for further replies.

LEICJDN1

Technical User
Nov 27, 2002
201
GB
Main page fine, but embedded Flash code from Macromedia Flash does not validate as XHTML.

Here is the offending code:

<OBJECT style=&quot;position:relative; left:16%&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;
codebase=&quot; WIDTH=&quot;400&quot; HEIGHT=&quot;292&quot; id=&quot;full pump animation&quot; ALIGN=&quot;&quot;>
<PARAM NAME=movie VALUE=&quot;NaKpumpanimation.swf&quot;> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src=&quot;NaKpumpanimation.swf&quot; quality=high bgcolor=#FFFFFF WIDTH=&quot;400&quot; HEIGHT=&quot;300&quot; NAME=&quot;full pump animation&quot; ALIGN=&quot;&quot;
TYPE=&quot;application/x-shockwave-flash&quot; PLUGINSPAGE=&quot;</OBJECT>

Any ideas how to get this XHTML strict?

Thanks!

JDN
 
may just need to make the param's an empty tag:

<PARAM NAME=movie VALUE=&quot;NaKpumpanimation.swf&quot;/>
 
Thanks.

Tried that, but no joy.

validator spits out this little lot!

Below are the results of attempting to parse this document with an SGML parser.

Line 23, column 14: there is no attribute &quot;style&quot; (explain...).
<OBJECT style=&quot;position:relative; left:16%&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96
^
Line 23, column 52: there is no attribute &quot;classid&quot; (explain...).
...position:relative; left:16%&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540
^
Line 24, column 10: there is no attribute &quot;codebase&quot; (explain...).
codebase=&quot; ^
Line 25, column 7: there is no attribute &quot;WIDTH&quot; (explain...).
WIDTH=&quot;400&quot; HEIGHT=&quot;292&quot; id=&quot;full pump animation&quot; ALIGN=&quot;&quot;>
^
Line 25, column 20: there is no attribute &quot;HEIGHT&quot; (explain...).
WIDTH=&quot;400&quot; HEIGHT=&quot;292&quot; id=&quot;full pump animation&quot; ALIGN=&quot;&quot;>
^
Line 25, column 29: there is no attribute &quot;id&quot; (explain...).
WIDTH=&quot;400&quot; HEIGHT=&quot;292&quot; id=&quot;full pump animation&quot; ALIGN=&quot;&quot;>
^
Line 25, column 57: there is no attribute &quot;ALIGN&quot; (explain...).
WIDTH=&quot;400&quot; HEIGHT=&quot;292&quot; id=&quot;full pump animation&quot; ALIGN=&quot;&quot;>
^
Line 25, column 59: element &quot;OBJECT&quot; undefined (explain...).
WIDTH=&quot;400&quot; HEIGHT=&quot;292&quot; id=&quot;full pump animation&quot; ALIGN=&quot;&quot;>
^
Line 26, column 13: there is no attribute &quot;NAME&quot; (explain...).
<PARAM NAME=movie VALUE=&quot;NaKpumpanimation.swf&quot; /> <PARAM NAME=quality VALUE=hig
^
Line 26, column 13: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
<PARAM NAME=movie VALUE=&quot;NaKpumpanimation.swf&quot; /> <PARAM NAME=quality VALUE=hig
^
Line 26, column 25: there is no attribute &quot;VALUE&quot; (explain...).
<PARAM NAME=movie VALUE=&quot;NaKpumpanimation.swf&quot; /> <PARAM NAME=quality VALUE=hig
^
Line 26, column 49: element &quot;PARAM&quot; undefined (explain...).
...=movie VALUE=&quot;NaKpumpanimation.swf&quot; /> <PARAM NAME=quality VALUE=high/> <PARA
^
Line 26, column 63: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
...NaKpumpanimation.swf&quot; /> <PARAM NAME=quality VALUE=high/> <PARAM NAME=bgcolor
^
Line 26, column 77: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
...on.swf&quot; /> <PARAM NAME=quality VALUE=high/> <PARAM NAME=bgcolor VALUE=#FFFFFF
^
Line 26, column 82: element &quot;PARAM&quot; undefined (explain...).
...f&quot; /> <PARAM NAME=quality VALUE=high/> <PARAM NAME=bgcolor VALUE=#FFFFFF/> <E
^
Line 26, column 96: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
...AME=quality VALUE=high/> <PARAM NAME=bgcolor VALUE=#FFFFFF/> <EMBED src=&quot;NaKp
^
Line 26, column 110: an attribute value must be a literal unless it contains only name characters (explain...).
...LUE=high/> <PARAM NAME=bgcolor VALUE=#FFFFFF/> <EMBED src=&quot;NaKpumpanimation.s
^
Line 26, column 118: element &quot;PARAM&quot; undefined (explain...).
.../> <PARAM NAME=bgcolor VALUE=#FFFFFF/> <EMBED src=&quot;NaKpumpanimation.swf&quot; qual
^
Line 26, column 131: there is no attribute &quot;src&quot; (explain...).
...E=bgcolor VALUE=#FFFFFF/> <EMBED src=&quot;NaKpumpanimation.swf&quot; quality=high bgco
^
Line 26, column 162: there is no attribute &quot;quality&quot; (explain...).
...D src=&quot;NaKpumpanimation.swf&quot; quality=high bgcolor=#FFFFFF WIDTH=&quot;400&quot; HEIGHT
^
Line 26, column 162: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
...D src=&quot;NaKpumpanimation.swf&quot; quality=high bgcolor=#FFFFFF WIDTH=&quot;400&quot; HEIGHT
^
Line 26, column 175: there is no attribute &quot;bgcolor&quot; (explain...).
...panimation.swf&quot; quality=high bgcolor=#FFFFFF WIDTH=&quot;400&quot; HEIGHT=&quot;300&quot; NAME=&quot;
^
Line 26, column 175: an attribute value must be a literal unless it contains only name characters (explain...).
...panimation.swf&quot; quality=high bgcolor=#FFFFFF WIDTH=&quot;400&quot; HEIGHT=&quot;300&quot; NAME=&quot;
^
Line 26, column 190: there is no attribute &quot;WIDTH&quot; (explain...).
... quality=high bgcolor=#FFFFFF WIDTH=&quot;400&quot; HEIGHT=&quot;300&quot; NAME=&quot;full pump anima
^
Line 26, column 203: there is no attribute &quot;HEIGHT&quot; (explain...).
... bgcolor=#FFFFFF WIDTH=&quot;400&quot; HEIGHT=&quot;300&quot; NAME=&quot;full pump animation&quot; ALIGN..
^
Line 26, column 214: there is no attribute &quot;NAME&quot; (explain...).
...FFFFF WIDTH=&quot;400&quot; HEIGHT=&quot;300&quot; NAME=&quot;full pump animation&quot; ALIGN=&quot;&quot;
^
Line 26, column 242: there is no attribute &quot;ALIGN&quot; (explain...).
...00&quot; NAME=&quot;full pump animation&quot; ALIGN=&quot;&quot;
^
Line 27, column 6: there is no attribute &quot;TYPE&quot; (explain...).
TYPE=&quot;application/x-shockwave-flash&quot; PLUGINSPAGE=&quot; ^
Line 27, column 50: there is no attribute &quot;PLUGINSPAGE&quot; (explain...).
...ation/x-shockwave-flash&quot; PLUGINSPAGE=&quot; ^
Line 27, column 95: element &quot;EMBED&quot; undefined (explain...).
... ^
Line 28, column 8: end tag for &quot;PARAM&quot; omitted, but OMITTAG NO was specified
</OBJECT>
^
Line 26, column 84: start tag was here (explain...).
... /> <PARAM NAME=quality VALUE=high/> <PARAM NAME=bgcolor VALUE=#FFFFFF/> <EMB
^
Huh?
 
Try changing your tag and attribute names to lower case, enure that all attribute values are enclosed in quotes, and make sure all tags either have an explicit closing tag or a / at the end.

e.g. Bad tag:
[tt]
<PARAM NAME=quality VALUE=high>
[/tt]
Good tag:
[tt]
<param name=&quot;quality&quot; value=&quot;high&quot; />
[/tt]

-- Chris Hunt
 
Thanks Chris Hunt, that has improved the situation.

So,the following code:

<object style=&quot;position:relative; left:16%&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;
codebase=&quot; width=&quot;400&quot; height=&quot;292&quot; id=&quot;full pump animation&quot;>
<param name=&quot;movie&quot; value=&quot;NaKpumpanimation.swf&quot; /> <param name=&quot;quality&quot; value=&quot;high&quot; /> <param name=&quot;bgcolor&quot; value=&quot;#FFFFFF&quot; /> <embed src=&quot;NaKpumpanimation.swf&quot; quality=high bgcolor=#FFFFFF width=&quot;400&quot; height=&quot;300&quot; name=&quot;full pump animation&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;</embed>
</object>

Gives the following errors:

Line 25, column 34: value of attribute &quot;id&quot; must be a single token
width=&quot;400&quot; height=&quot;292&quot; id=&quot;full pump animation&quot;>
^
Line 26, column 143: there is no attribute &quot;src&quot; (explain...).
...color&quot; value=&quot;#FFFFFF&quot; /> <embed src=&quot;NaKpumpanimation.swf&quot; quality=high bgco
^
Line 26, column 174: there is no attribute &quot;quality&quot; (explain...).
...d src=&quot;NaKpumpanimation.swf&quot; quality=high bgcolor=#FFFFFF width=&quot;400&quot; height
^
Line 26, column 174: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
...d src=&quot;NaKpumpanimation.swf&quot; quality=high bgcolor=#FFFFFF width=&quot;400&quot; height
^
Line 26, column 187: there is no attribute &quot;bgcolor&quot; (explain...).
...panimation.swf&quot; quality=high bgcolor=#FFFFFF width=&quot;400&quot; height=&quot;300&quot; name=&quot;
^
Line 26, column 187: an attribute value must be a literal unless it contains only name characters (explain...).
...panimation.swf&quot; quality=high bgcolor=#FFFFFF width=&quot;400&quot; height=&quot;300&quot; name=&quot;
^
Line 26, column 202: there is no attribute &quot;width&quot; (explain...).
... quality=high bgcolor=#FFFFFF width=&quot;400&quot; height=&quot;300&quot; name=&quot;full pump anima
^
Line 26, column 215: there is no attribute &quot;height&quot; (explain...).
... bgcolor=#FFFFFF width=&quot;400&quot; height=&quot;300&quot; name=&quot;full pump animation&quot; type=&quot;a
^
Line 26, column 226: there is no attribute &quot;name&quot; (explain...).
...FFFFF width=&quot;400&quot; height=&quot;300&quot; name=&quot;full pump animation&quot; type=&quot;application/
^
Line 26, column 253: there is no attribute &quot;type&quot; (explain...).
...300&quot; name=&quot;full pump animation&quot; type=&quot;application/x-shockwave-flash&quot; pluginsp
^
Line 26, column 297: there is no attribute &quot;pluginspage&quot; (explain...).
...ation/x-shockwave-flash&quot; pluginspage=&quot; ^
Line 26, column 342: element &quot;embed&quot; undefined (explain...).
... ^
ANy other ideas or is it just a case that embedded Flash will never validate as XHTML !?
 
&quot;Line 25, column 34: value of attribute &quot;id&quot; must be a single token
width=&quot;400&quot; height=&quot;292&quot; id=&quot;full pump animation&quot;>&quot;

id's in XML can't contain spaces. Try using underscores or hyphens instead.

Most of your other problems (apart from the odd missing &quot;s) come from the fact that <embed> is not a valid XHTML tag. It's a Netscape tag used to present the movie to NN users (and, apparently, IE Mac users). See


My guess is that Mozilla, NS6+, Opera etc. probably understand the <object> tag, making the <embed> tag unnecessary. However, unless you can be sure that everyone visiting your page has an up-to-date browser, it's probably worth leaving it in and accepting the fact that the page won't validate.

-- Chris Hunt
 
Thanks,

You are correct on all counts. Removing the EMBED tag and sorting out the id leads to full validation, at the expense of failure to display the flash movie in Netscape Navigator 7.0.

So, looks like that page will have to stay invalid for now.


THanks for your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top