1

I know that a language is extensible if it allows users to create any tags needed and then describing those tags and their permitted uses.

If I'm not wrong, in this example

code:

<!ELEMENT people_list (person)*>
<!ELEMENT person (name, birthdate?, gender?, socialsecuritynumber?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT birthdate (#PCDATA)>
<!ELEMENT gender (#PCDATA)>
<!ELEMENT socialsecuritynumber (#PCDATA)>

The DTD is defining an element (tag) called person, another element called name etc...

So, why this is not extensible as XSD?

kjhughes
  • 106,133
  • 27
  • 181
  • 240
Iledran
  • 133
  • 1
  • 12

1 Answers1

0

Background: DTD exists to support the extensibility of XML. Instead of a fixed markup language, XML allows you to define your own vocabulary and grammar via a schema such as DTD.

Why DTD is not extensible?

DTD is extensible.

  • DTDs can be extended via various techniques. Examples include repeating ATTLIST to add attributes and redefining parameter ENTITIES.
  • There's a long history of clever DTD extensibility applied to substantial projects. Examples:

So, why this is not extensible as XSD?

Because DTD predates XSD, and progress occurs.

See also

kjhughes
  • 106,133
  • 27
  • 181
  • 240
  • [Here](https://www.javatpoint.com/dtd-vs-xsd) it's mentioned that DTD is not extensible. It's also mentioned in page 22 of [this](https://www.amazon.com/XML-Programming-Using-Microsoft-Parser/dp/1893115429) book (look [here](https://books.google.com/books?id=6bgYAAAAQBAJ&pg=PA22&lpg=PA22&dq=%22dtd+is+not+extensible%22&source=bl&ots=H0etU58RdO&sig=Mw5eQOSHYWePj4Occ8cvspkGMAA&hl=en&sa=X&ved=0ahUKEwjAvcyx-trbAhVEWK0KHaD8BRIQ6AEIRjAD#v=onepage&q=%22dtd%20is%20not%20extensible%22&f=false)). And also in [oracle documentation](https://docs.oracle.com/cd/B14099_19/integrate.1012/b14069/xsd.htm) – Kennet Celeste Jun 17 '18 at 14:55
  • @KennetCeleste: Seriously? You down-voted this refined answer based upon decades of experience building real systems using both DTDs and XSDs and cite sweeping one-line generalizations as justification? Yes, of course, XSDs afford greater flexibility. As I stated, ***progress occurs***. If *you're* satisfied with high-level, bullet-pointed generalizations, feel free to limit your understanding to "is-to/is-not" extensible arguments. Here, I offer a bit more subtle answer and give a glimpse into how projects have achieved a degree of extensibility with DTD. – kjhughes Jun 17 '18 at 16:19