Page 1 of 1

is possible [REWRITE, ADD, EXTEND] a element of DTD?

Posted: Mon Oct 28, 2019 8:49 pm
by oXygen
hello,
I need use/create XHTML documents.

by years I use this four lines:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es">
<head>.
.
.
</head><body>...
now I need add my own group of TAGS:
mytagone,
mytagtwo,
...

I try with:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
[
<!ELEMENT mytagone (#PCDATA>
<!ELEMENT mytatwo (#PCDATA>
<!ELEMENT mytagtree (#PCDATA>
]>
but https://validator.w3.org/ ever reply:
document type does not allow element "mytag" here
why?
becouse ELEMENT body defined in the DTD http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd no´t include the ELEMENT (tag) "<mytagone>".

How I can:
  1. Load the external DTD http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
  • ADD my own DTD with my own group of TAGS
???

Thanks by your help!

Re: is possible [REWRITE, ADD, EXTEND] a element of DTD?

Posted: Wed Oct 30, 2019 7:28 pm
by adrian
Hi,

What's the use case? What are you trying to accomplish with those custom elements/tags?
The problem is this won't validate as XHTML 1.1, simply because XHTML 1.1 doesn't allow custom elements.
You can probably make it validate by itself as XML since the XHTML 1.1 DTDs are extendable. Have a look here:
https://www.w3.org/TR/xhtml-modularizat ... oping.html

Regards,
Adrian