Quote:
Originally Posted by Gulzor
I thought I could modify the official DTD for XHTML1.1 (transitional) and define my custom tags in it.
there is no XHTML 1.1 transitional DTD (there's only one DTD for XHTML 1.1)
you can write your own DTD using the official one as a base or extend/redefine some of the official elements. the question is, if the browsers support that (a question to Dr. Google).
Quote:
Originally Posted by Gulzor
But then I might lost the benefits of namespaces since my custom tags will be merged with the regular HTML tags ?
you wouldn't. a DTD simply checks, if a document conforms to a given structure. not more, not less. the benefit of namespaces is not affected by a DTD.
Quote:
Originally Posted by Gulzor
At this time, I use PHP preg_* functions to parse the HTML file and trigger actions when I detect a tag that starts with the string "namespace:".
if these elements only trigger some server side action, remove them before you send the document to the browser. all that will be left is XHTML.
Quote:
Originally Posted by Gulzor
2) I would like to use DOMDocument::getElementsByTagNameNS() to retrieve all my custom tags.
sounds reasonable. code samples you'll find
here
regards
note: IE doesn't support XHTML (i.e. it doesn't support the XHTML MIME type (and probably never will)) so make sure IE will be given an according document. (if you have XHTML 1.1 you probably know, what MIME type should be served (if not, see
XHTML Media Types))