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

Is there a way to access the XML declaration in XHTML documents #415

Closed
ronancremin opened this issue Mar 6, 2012 · 0 comments
Closed
Labels

Comments

@ronancremin
Copy link

Hi,

Some XHTML documents are served with an XML declaration e.g.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>

In a browser you can access the XML declaration with window.document.firstChild.data e.g. in this case:

window.document.firstChild.data
"?xml version="1.0" encoding="UTF-8"?"

But this doesn't seem to work with jsdom (the firstChild is the doctype). Is there a way to access this declaration with jsdom?

Sebmaster pushed a commit that referenced this issue Dec 2, 2015
Fixes #393. Fixes #651. Fixes #415 (wasn't quite applicable). Fixes #1276.
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

2 participants