Hi,
I have defined a set of custom tags that I put among regular HTML tags. E.g.
<body>
<div id="regular_id">
<namespace:container id="something" type="article" />
</div>
</body>
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:".
It works but I feel that I can do better with PHP DOM API :
Question : am I right on this ?
1) I would like to create either a DTD or a Schema for my custom tags and validate my HTML file against this.
I thought I could modify the official DTD for XHTML1.1 (transitional) and define my custom tags in it.
But then I might lost the benefits of namespaces since my custom tags will be merged with the regular HTML tags ?
2) I would like to use DOMDocument::getElementsByTagNameNS() to retrieve all my custom tags.
I don't know what's the best strategy.
All advises appreciated, code sample also ;-)
Thank you.