To use a custom element, you don’t need any DTD things. Browsers are DTD-ignorant (well, mostly). Just use the element. And use whatever doctype
string you would use otherwise, such as the simple <!doctype html>
.
But if you have any CSS styling for a custom element, then you need to introduce it with JavaScript, if you wish the styling to work in old versions of IE, too (IE 8 and older). In this case, you would put the following before the first reference to any stylesheet:
<script>
document.createElement('circular-view');
document.createElement('circular-object');
</script>
In this case, you probably don’t want to style these elements, so the script code isn’t needed.
Whether you should use custom tags is a different issue, and there are many questions on this at SO, see e.g. Using custom HTML Tags
The reason why you see “]>” is that when using HTML parsers, browsers do not process internal subsets of document type declarations, i.e. the [...]
part. Instead they stop parsing when they see [
and thus take [>
as character data.
The declaration is malformed even in principle, since it has only the internal subset, so it would make all other elements invalid.
When using XML (XHTML) parsers, modern browsers properly parse the internal subset, but they ignore element declarations. They are not validating processors, so they would have no use for element declarations.