Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

How REWRITE or ADD or EXTEND a element in a DTD?

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello.

in my document XHTML I add my own tag in this form:



but W3C say [document type does not allow element "mytag" here]

then I need ADD, EXTEND, REWRITE the ELEMENT "BODY" to add "mytag" ???


Please any help is valuated.


Regards
 
Saloon Keeper
Posts: 21266
138
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using DTD instead of XML schema? DTDs are pretty crude and inflexible.
 
Gabriel Pinares
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:Why are you using DTD instead of XML schema?

Thanks.

Because I am not a expert programmer.
Additionally my english is poor.

I believe XHTML for WEB require this two lines key:

  • <?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">

  • I am no´t sure, but I need add the tag and others tags...

    Then I want "include" my DTD and I modify the two lines key (mandatory) with:but something is wrong...

    please,
    some idea about how I can fix this?

    maybe no't is mandatory the line #2 ??
     
    Tim Holloway
    Saloon Keeper
    Posts: 21266
    138
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Gabriel Pinares wrote:Additionally my english is poor.



    No es problema. Kein problem. без проблем.

    We speak English here, but we come from everywhere, so we're used to making sense (most of the time) from other people who are not native English speakers.

    A DTD or XML schema is a document that is used as a template by an XML parser to ensure that the XML contents are valid. Usually this document is separate from the actual XML content itself so that it can be applied to many XML documents which are all of the same form without having to copy the template into the XML itself. But a DTD can be done inline like you are doing here.
    I think where you went wrong was when you confused the DTD with the meta-language used to descripe a DTD. That is, you coded the square brackets, but the square brackets aren't supposed to be part of the DTD. They're meta-information that indicates that something is optional.

    There are common conventions for syntax descriptions, and some documents will explain them, especially since they are only conventions and there's no actual standard for meta-information. But after a while you get a pretty good idea of how it works.

    Some more concrete help with DTD is here: https://www.w3schools.com/xml/xml_dtd_intro.asp
     
    Gabriel Pinares
    Greenhorn
    Posts: 19
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Tim Holloway wrote:...We speak English here, but we come from everywhere, so we're used to making sense (most of the time) from other people who are not native English speakers.

    Thanks by your patience.

    Tim Holloway wrote:Some more concrete help with DTD is here: https://www.w3schools.com/xml/xml_dtd_intro.asp

    Thanks, just I get from this web the line after I was seek in NET and I was find "the trick" [ include DTD ].

    But I can´t validate my XHTML document.

    Please:
    what is the correct code to ADD/PUT new tags in XHTML ?
     
    crispy bacon. crispy tiny ad:
    Java file APIs (DOC, XLS, PDF, and many more)
    https://products.aspose.com/total/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!