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

Questions about XML that are not covered by the other forums should go here.
oXygen
Posts: 1
Joined: Mon Oct 28, 2019 8:33 pm

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

Post by oXygen » Mon Oct 28, 2019 8:49 pm

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!

adrian
Posts: 2654
Joined: Tue May 17, 2005 4:01 pm

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

Post by adrian » Wed Oct 30, 2019 7:28 pm

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Post Reply