Questions tagged [dtd]

DTD stands for "Document Type Definition" as specified in the XML 1.x Recommendations of the W3C. DTDs define formal grammars for XML documents: which tags you can use and where you can use them. Validating XML processors apply this grammar to XML documents to determine whether they conform to these grammars, in which case the document is "valid".

DTD stands for "Document Type Declaration" as specified in the XML 1.x Recommendations of the W3C (see http://www.w3.org/TR/xml/).

The XML document type declaration contains or points to markup declarations that provide a grammar for a class of documents. This grammar is known as a document type definition, or DTD. The document type declaration can point to an external subset (a special kind of external entity) containing markup declarations, or can contain the markup declarations directly in an internal subset, or can do both. The DTD for a document consists of both subsets taken together.

DTDs were also specified in SGML (ISO 8879:1986), the forbear to XML. SGML DTDs are more feature-rich than XML DTDs, allowing for example the specification of tag minimization features.

References:

1433 questions
227
votes
18 answers

No grammar constraints (DTD or XML schema) detected for the document

I have this dtd : http://fast-code.sourceforge.net/template.dtd But when I include in an xml I get the warning : No grammar constraints (DTD or XML schema) detected for the document. The xml is :
fastcodejava
  • 39,895
  • 28
  • 133
  • 186
202
votes
19 answers

How to generate sample XML documents from their DTD or XSD?

We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ourselves from these files. Is there an…
lindelof
  • 34,556
  • 31
  • 99
  • 140
201
votes
12 answers

What is difference between XML Schema and DTD?

I have googled this question, but I do not understand clearly what is an XML schema and DTD (document type definition), and why the XML schema is more powerful compared to DTD. Any guidance would be highly appreciated.
Rachel
  • 100,387
  • 116
  • 269
  • 365
180
votes
8 answers

What is DOCTYPE?

What is DOCTYPE and why do I want to use it? What are the different DOCTYPEs I can use? What is the difference between standards and quirks mode, and what are some quirks I may run into with differently set DOCTYPEs? Lastly, what is the proper…
Bob
  • 97,670
  • 29
  • 122
  • 130
129
votes
7 answers

XML schema or DTD for logback.xml?

I've seen several discussions on the net about how great it would be to have an XML schema or DTD for logback.xml file to have at least the very basic validation and auto-completion in IDEs like IDEA or Eclipse, but I never saw any solution. Did…
Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
93
votes
7 answers

Difference between PCDATA and CDATA in DTD

What is the difference between #PCDATA and #CDATA in DTD?
Jakub Arnold
  • 85,596
  • 89
  • 230
  • 327
90
votes
7 answers

Make DocumentBuilder.parse ignore DTD references

When I parse my xml file (variable f) in this method, I get an error C:\Documents and Settings\joe\Desktop\aicpcudev\OnlineModule\map.dtd (The system cannot find the path specified) I know I do not have the dtd, nor do I need it. How can I parse…
joe
  • 16,988
  • 36
  • 94
  • 131
89
votes
13 answers

Is there any difference between 'valid xml' and 'well formed xml'?

I wasn't aware of a difference, but a coworker says there is, although he can't back it up. What's the difference if any?
user18931
  • 10,715
  • 9
  • 28
  • 21
73
votes
5 answers

Where is the HTML5 Document Type Definition?

The "old" HTML/XHTML standards have a DTD (Document Type Definition) defined for them: HTML 4.01 http://www.w3.org/TR/html401/sgml/dtd.html XHTML 1.0 http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Strict This DTDs specify the rules for…
Šime Vidas
  • 182,163
  • 62
  • 281
  • 385
65
votes
7 answers

Disable DTD warning for Ant scripts in Eclipse?

I'm using Eclipse Ganymede. Everything works fine, but I have an anal-retentive yearning for a warning-free Problems tab. Right now it (correctly) complains about my Ant scripts: "No grammar constraints (DTD or XML schema) detected for the…
Brian Deacon
  • 21,384
  • 13
  • 39
  • 41
65
votes
4 answers

Free DTD to XSD conversion utility?

I have a DTD that I need to convert to an XSD (XML schema) file. Is there a free utility or simple way to accomplish this?
Jeremy Stein
  • 19,171
  • 16
  • 68
  • 83
53
votes
7 answers

How to choose between DTD and XSD

I want to use either a DTD or an XSD to describe my XML document. I've read that XSDs are better than DTDs since they support namespaces and data types, and that DTDs are older. Does this mean that I should only use XSDs for all future needs and…
ajsie
  • 77,632
  • 106
  • 276
  • 381
51
votes
7 answers

Installing xmllint

I needed help installing xmllint from this website: http://xmlsoft.org/sources/win32/ In particular, I am not sure which file I am supposed to download - when I click the link for precompiled Windows binaries I am brought to a list of several files…
sgx
  • 1,265
  • 3
  • 19
  • 36
50
votes
4 answers

Why are nested anchor tags illegal?

I learned that nesting anchor tags is not standards compliant HTML. From W3: Links and anchors defined by the A element must not be nested; an A element must not contain any other A elements. Since the DTD defines the LINK element to be empty,…
Doug Morrow
  • 1,306
  • 1
  • 10
  • 18
37
votes
5 answers

Where are the schemas for XML files on an Android project?

Where are the schemas (DTD or XML schema) for the XML files used on Android like AndroidManifest.xml or the layouts?
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
1
2 3
95 96