Hi all,

I've hit an issue with the DOMCrawler this week when using the FOS Facebook
bundle along with Behat for testing.  The Facebook login button code added
to the page looks something like this:

<fb:login-button perms="" autologoutlink="1"></fb:login-button>

I also add in the relevant xmlns:fb attribute on the html tag.

If I'm testing the response output via the DOMCrawler, and the content type
of the response is set to text/html (default), then the crawler fails as it
uses the DOMDocument loadHTML() method internally which doesn't support
namespaced tags.  If I switch the content type to application/xhtml+xml then
the same occurs (with the browser rendering as XML).  I need to use
application/xml to get the DOMCrawler to parse the document as XML, and
hence deal with namespaces. But this is the incorrect type

Am I missing something obvious here? It seems at first that the use of the
loadHTML method should be removed in favour of using the loadXML method
currently used for non-HTML documents, although then this would remove the
ability to check badly-formed HTML. Either that or the regex to detect the
type of the page (xhtml/html etc) should be updated to cater for XHTML
documents, but I'm not sure how many people actually serve their XHTML pages
as application/xhtml+xml ;-) But at present, I'm stuck being able to test
XHTML pages with namespaced tags.

Thanks,

Rich.

-- 
Rich Sage
York, UK
rich.s...@gmail.com

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to symfony-devs@googlegroups.com
To unsubscribe from this group, send email to
symfony-devs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to