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
-1
votes
1 answer

Can root element have text in it?

Can root element have text in it? For example if the DTD is: ]> can the XML document be hello ?
-1
votes
1 answer

Defining "DTD" with OpenAPI

I want to define a schema and be able to generate stubs to parse it. I am looking into OpenAPI and Swagger Codegen. I wrote some time ago a test XSD and generated Java bindings for it. This schema is simply a number of POJOs. I know of other…
Miguel
  • 11
  • 3
-1
votes
1 answer

XML code into DTD code

Well-formed code of XML is given below which is showing the hierarchy of different courses in Computer Science Department of University. I have convert the xml code into dtd code. Where am I wrong. My XML Code
-1
votes
2 answers

TestNG XML DTD error

I'm running selenium script with testng xml, however till now, everything was working, but now it always throws error, however when I remove first line, it is working with warning TestNG xml file as below
Prasad_Joshi
  • 642
  • 3
  • 13
  • 34
-1
votes
1 answer

xml document type definition --> allow only different values

i have a simple xml like this: my problem is now that the user is only allowed to insert some DIFFERENT tastes --> how can i make sure with the DTD file that the user can only type in…
nbg15
  • 129
  • 1
  • 3
  • 11
-1
votes
1 answer

How can we generate DTD from class java

I have a Java application. How can I generate a DTD from a Java class? I don't know how to do that.
Nina PRO
  • 91
  • 2
  • 13
-1
votes
1 answer

Attribute "type" must be declared for element type "policy". DTD

OK so I'm trying to validate the following XML file with the following DTD, but I keep getting the error Attribute "type" must be declared for element type "policy". The XML file is shown as below:
OysterMaker
  • 279
  • 2
  • 13
  • 26
-1
votes
3 answers

One validation says code is okay, another say it is not valid

Okay so I have been tooling around with this for hours and I still can't seem to figure out what the problem is, but this is what I have so far. This is from the site that the instructor gave us to validate our xml, and from the validating service…
John Joseph
  • 189
  • 2
  • 3
  • 14
-1
votes
1 answer

Is there an example of a DTD which has no valid document instances?

If we say a DTD is satisfiable if there is a document which is valid against the DTD, is there any example of DTD which is not satisfiable?
alex
  • 47
  • 6
-1
votes
1 answer

Options in a DTD

I am editing my last post with a whole new question about the same assignment. I ended up submitting my assignment and the professor said it had a lot of errors. So I have been working on it for the past few weeks and am stuck in my current…
Randy Gilman
  • 457
  • 1
  • 11
  • 21
-1
votes
2 answers

XML DTD parent object same with child object

For an example. inside my xml ( ( 24
user3553846
  • 342
  • 1
  • 15
-1
votes
3 answers

Defning a DTD to store multiple instances of a value

can you please tell how i can extend the following code so that five professions can be added in the xml document?
Selom
  • 729
  • 8
  • 15
  • 21
-1
votes
1 answer
-1
votes
3 answers

Need help understanding DTD schema

I'm quite new to XML, can someone tell me what exactly this code is supposed to do?
Selom
  • 729
  • 8
  • 15
  • 21
-1
votes
2 answers

Learning (X)HTML using the DTD

I'm thinking of learning (X)HTML. I have read on the web about w3schools and discussions on the subject and intend to stay away from it (or at most use it as a reference). I think it is best when learning programming languages to go to the original…