Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCTYPE specified in template is not honoured by EPrints #22

Open
jesusbagpuss opened this issue Oct 20, 2016 · 6 comments
Open

DOCTYPE specified in template is not honoured by EPrints #22

jesusbagpuss opened this issue Oct 20, 2016 · 6 comments
Labels

Comments

@jesusbagpuss
Copy link

In the templates, the html5 doctype is defined:
<!DOCTYPE html>

Somehow EPrints mangles this back to
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
e.g. http://data.uel.ac.uk/12/

I think this can then cause issues in IE, when combined with the
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
tag.

@mpbraendle
Copy link

This seems to be caused by the module perl_lib/EPrints/XHTML.pm, as we recently wrote in a ep-tech post.

@jesusbagpuss
Copy link
Author

Ah, yes - I've just found that post.
I'm tracing it through the wonders of 3.3.10 now - hosting multiple archives which may want either doctype (until we re-skin them all)... ☹️

@jesusbagpuss
Copy link
Author

It's also in here:
https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/XML.pm#L735-L763

@jenswitzel
Copy link

jenswitzel commented Oct 24, 2016

Had (and still have) the same problem: After 're-skin' with bootstrap we crashed using the W3C validation, because eprints overwrites the DOCTYPE-declaration in our new template / style.

Support was telling me, that changing this in module perl_lib/EPrints/XHTML.pm unfortunately has bad side effects - stopping the templates working. This is because the XML parser is reaching out over the Web to download and work against the DTD.

Still waiting for support answer and let you know what todo.

@jenswitzel
Copy link

jenswitzel commented Nov 24, 2016

Now (!) support gave me a fullfilling answer and it's easy: EPrints still uses (and needs!) XHTML and DTD validation for internal use (templates, xpag, etc.). XHTMLOutput to the browser could be easily changed in perl_lib/EPrints/XHTML.pm

Change any <DOCTYPE> and <html> like '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >' into '<!DOCTYPE html>'

@orazionelson
Copy link

This solution affects all the instances. I've an archive with different instances and I want to move gradually to HTML5, so how to have a mixed solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants