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

Mobile Document Type Definition

Mobile site is not showing correctly. I have to zoom in to view my site correctly even if I have the correct DTD:
Tech4Wilco
  • 6,740
  • 5
  • 46
  • 81
14
votes
2 answers

.NET: Prevent XmlDocument.LoadXml from retrieving DTD

I have following code (C#), it takes too long and it throws exception: new XmlDocument(). LoadXml(""); I understand why it does that. My question is how do I make it…
THX-1138
  • 21,316
  • 26
  • 96
  • 160
13
votes
4 answers

DTD required elements ordering

I want to have list of required elements in any order defined in dtd, but have no idea how I could do this. For example, I have following definition: This dtd declaration will successfully validate…
altern
  • 5,829
  • 5
  • 44
  • 72
13
votes
8 answers

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

I have the same problem as many here, but i DO HAVE xmlns:android and the xml=... tags. Still I have the same error. I don't wan't just click the ignore instead of warning in the settings so hence the question here posted. The source is:
Hoornet
  • 1,398
  • 3
  • 18
  • 30
12
votes
2 answers

XML, what is this: null or empty element?

Regarding to my other question: XML deserialize null elements? I've got elements like these from a third-party server for API testing: I just realized that now I am confusing myself about whether elements like…
Paul L
  • 2,240
  • 5
  • 36
  • 55
12
votes
1 answer

Including a DTD in another DTD

Is it possible to include a DTD in another DTD? (I don't mean copy-and-paste the second DTD into the first DTD. I mean to have something like a pointer to the second DTD in the first DTD.)
Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
12
votes
3 answers

How can I prevent XML::XPath from fetching a DTD while processing an XML file?

My XML (a.xhtml) starts like this ... My code starts like this use XML::XPath; use XML::XPath::XMLParser; my $xp =…
yogman
  • 4,021
  • 4
  • 24
  • 27
12
votes
2 answers

DTD with RFDa and XHTML 1.0 Transitional support

Is there a W3C document type available with both XHTML 1.0 transitional support and RDFa support? I am aware of the XHTML+RDFa 1.0 (http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd) DTD but that is XHTML 1.1 which is not compatible with my current…
Wolph
  • 78,177
  • 11
  • 137
  • 148
12
votes
1 answer

Can XML attributes have spaces?

I'm creating a DTD for an xml document. I have an Enumerated attribute for an xml element. My question is: Can the attribute Type have spaces? eg:
Christian Payne
  • 7,081
  • 5
  • 38
  • 59
12
votes
9 answers

Special Characters in XML

I am creating a left navigation system utilizing xml and xsl. Everything was been going great until I tried to use a special character in my xml document. I am using » and I get th error. reason: Reference to undefined entity 'raquo'. error…
BillZ
  • 247
  • 3
  • 4
  • 9
12
votes
9 answers

How to derive DTD (or other XML spec format) from XML file samples

Do you know of a tool that will derive a DTD (or other XML structure specification format) from a sample set of XML files? Currently the only (automatic) validation we have for an xml encoded DSL is a legacy parser written in Perl, but for…
lexu
  • 8,766
  • 5
  • 45
  • 63
11
votes
4 answers

Referring to a local DTD in Java

I have some XML that I'm parsing with a SAX parser in Java. It starts with this preamble: How do I change this to use a local…
Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
11
votes
2 answers

How to define DTD without strict element order?

As an XML "noob" I have discovered the importance of element order when creating an XML stream/file that is validated against a DTD. Is it possible to define a DTD that is not order dependent on elements ? If, so please provide syntactic example.
angryITguy
  • 9,332
  • 8
  • 54
  • 82
11
votes
4 answers

Parsing an XML file with a DTD schema on a relative path

I have the following java code: DocumentBuilder db=DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc=db.parse(new File("/opt/myfile")); And /opt/myfile contains something like:
User1
  • 39,458
  • 69
  • 187
  • 265
11
votes
1 answer

How can I force a SAX parser to use a DTD if one is not specified in the input file?

How can I force a SAX parser (specifically, Xerces in Java) to use a DTD when parsing a document without having any doctype in the input document? Is this even possible? Here are some more details of my scenario: We have a bunch of XML documents…
Kaypro II
  • 3,210
  • 8
  • 30
  • 41
1 2
3
95 96