puneetdudeja
asked on
DomDocument::loadXML not working
My following code in PHP is not working :-
But ,if I assign "<object><embed></embed></ object>" to $code, then its working correctly.
Any help is appreciated..
But ,if I assign "<object><embed></embed></
Any help is appreciated..
$code = '<object width="425" height="344">
<param name="movie" value="http://www.youtube.com/v/O68vsj_DHXU&hl=en_US&fs=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/O68vsj_DHXU&hl=en_US&fs=1"
type="application/x-shockwave-flash" width="425" height="344"
allowscriptaccess="always" allowfullscreen="true">
</embed>
</object>';
$doc = new DomDocument();
$doc->loadXML($code);
ASKER
I can't modify the code for embedding the object.
It is being filled by the user of our site and is coming directly from the database from his account.
It is being filled by the user of our site and is coming directly from the database from his account.
ASKER
If I remove the the "movie" parameter from <object> and "src" attribute from "embed", then also its working fine...
XHTML 1.0 compliant website that embedded a video from YouTube, you must be getting validation errors related to YouTube's use of the <embed> tag, which has been deprecated in XHTML 1.0.
If you're looking to embed a YouTube video in your website's code and want to retain your validity...
may be you can change the code when the client of your website insert the data for the code to embed...and let the proper data go to your database...
it may be the client side third party you can contact or modify the input for your website...
thanks,
Kalpan
If you're looking to embed a YouTube video in your website's code and want to retain your validity...
may be you can change the code when the client of your website insert the data for the code to embed...and let the proper data go to your database...
it may be the client side third party you can contact or modify the input for your website...
thanks,
Kalpan
ASKER
Removing the "embed" tag doesn't makes any difference, still the "loadXML()" is throwing error if only <object> tag is used.
you must be getting the following error...or something similar
DOMDocument::loadXML() [<a href='domdocument.loadxml' >domdocume nt.loadxml </a>]: EntityRef: expecting ';' in Entity, line: 1
so even if you remove the some tag but u still missing the validation with object tag which is non-compliant with XHTML ....
Please try doing this on simple php page....
Kalpan
DOMDocument::loadXML() [<a href='domdocument.loadxml'
so even if you remove the some tag but u still missing the validation with object tag which is non-compliant with XHTML ....
Please try doing this on simple php page....
Kalpan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use the following format: place your links as per the below
$code = '<object type="application/x-shockw
data="http://www.youtube.com/v/7_6B6vwE83U"><param name="movie" value="http://www.youtube.com/v/7_6B6vwE83U" /></object>';
Hope this will help...
Thanks
Kalpan
Open in new window