I have a web page (php) which handles a series of ajax forms and simple js hide/show divs based on content from an external upload to be used by registered members of an organization. In order to build a more maintainable and extendable site, I have been looking into using architectural patterns to prevent unending jQuery chaining; namely, the mediator pattern. Has anyone used Jack Lawson's Mediator.js? Basically, you can Subscribe with the Mediator to listen on a "channel" (namespaces) with a function to be run when something is Published on that same channel (and even check a predicate true/false function before responding, if needed). The Goal:The mediator.js api seems like it has great potential as well as forcing me to implement a valid xhtml document and use namespaces correctly. Implementing a mediator pattern seems like a great way to decouple the javascript code and make a complicated web-app much more maintainable and extendable in the future. The Frustration: I believe I understand both namespaces and the mediator pattern as implemented by the mediator.js api. I have been able to successfully publish DOM attribute events through a mediator on specific "channels" (namespaces) and Subscribe to those channels and react to them - even using the mediator.js method of testing a "predicate" on that channel in order to ascertain whether a response is necessary. But my CSS is now incapable of recognizing elements due to the new namespaces. I created namespaces like this:\[code\]<xmlns:active='http://www.xxx.com/tracks/active' xmlns:completed='http://www.xxx.com/tracks/completed' xmlns:inactive='http://www.xxx.com/tracks/inactive'>\[/code\]and then applying them to html elements, like:\[code\]<active:div ...>stuff</active:div>\[/code\]I changed the css file accordingly:\[code\]active|div { css formatting }\[/code\]Still, the page's css formatting is broken.The doctype portion of the rendered page looks like:\[code\]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">\[/code\]I am not entirely sure this isn't required, but I have tried adding:\[code\]<? header('Content-Type: application/xhtml+xml'); ?>\[/code\]Which produces an XML parsing error of:\[quote\] XML Parsing Error: not well-formed\[/quote\]which points to the equal sign in this namespace definition \[code\]xmlns:active='http://www.xxx.com/tracks/active'\[/code\] as the problem, but every doc I read shows this as being correct syntax. Questions:[*]Why is my CSS broken after implementing the namespaces I showedabove? [*]Why, when I add the \[code\]<? header('Content-Type:application/xhtml+xml'); ?>\[/code\] in the header, do I get the parsing errormentioned?Thank you for any help.