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

XML DTD Activity

Hi I'm new to xml and DTD.... I just learned this from class 2 hours ago... I have made an XML with a DTD.. I just want to know if my DTD for the XML code is correct? DTD: < !DOCTYPE BusinessCard[
Shan
  • 1
  • 1
0
votes
1 answer

DOM4J validate xml against DTD provided at runtime

I need to validate a multiple files produced by a third party against a DTD; The files don't have dtd declaration and I can't change this because I am not the owner, Is there a way of validating them using dom4j by providing the DTD…
John Stadt
  • 500
  • 7
  • 17
0
votes
1 answer

Why does this DTD fail when its almost identical twin doesn't?

Given this snippet of an XMLfile: NASCENT Default System Name
Wes Miller
  • 2,191
  • 2
  • 38
  • 64
0
votes
1 answer

xmlReadFile() (C++ Ubuntu) core dumps on broken XML

I am using the libxml2 libraries to parse XML sent to me (my program) as a file from another program. With care that should mean that I never get bad XML, but twice already I've made hand tweaks that broke the XML in the received file. By broken I…
Wes Miller
  • 2,191
  • 2
  • 38
  • 64
0
votes
1 answer

simplexml_load_file ignore the DTD

I am using simplexml_load_file to parse an XML file that must follow a DTD. Both XML and DTD are local files. $obj_xml = simplexml_load_file( $str_xml_file, 'SimpleXMLElement', LIBXML_DTDVALID + LIBXML_NOENT ); if…
giuliot
  • 156
  • 13
0
votes
2 answers

How to define attributes to optional element?

My XML may contain multiple param entries, each with key and value attribute likes this:
Shlomo
  • 3,880
  • 8
  • 50
  • 82
0
votes
2 answers

How to add one more dtd to my Spring configration file?

I have use a .dtd to my applicationContext.xml, but now i want to use Spring's AOP based on annotation. I've been told to add a in my applicationContext.xml.
MangMang
  • 427
  • 1
  • 5
  • 17
0
votes
3 answers

InDesign CS5 Script: How can I ignore the DTD when importing XML?

I am importing XML into InDesign, and I get this message: The external entity 'blahblah.dtd' cannot be found. Continue to import anyway? And when I then continue to import the XML, I get this error message: Javascript Error! Error Number:…
Ian Campbell
  • 2,678
  • 10
  • 56
  • 104
0
votes
1 answer

Am I using this .DTD incorrectly, or just misunderstanding what it should be doing?

Thanks for reading my question. I have searched for and read similar questions, but none of them quite explained what was going on. I have an XML file:
Paul
  • 3,318
  • 8
  • 36
  • 60
0
votes
1 answer

DTD to XSD conversion

I stuck with the following conversion from DTD: to XSD:
Andrey Borisko
  • 4,511
  • 2
  • 22
  • 31
0
votes
2 answers

xml parsing problem with c# linq to xml - Reference to undeclared entity

tryin to parse an xml file gives me the following error Reference to undeclared entity 'eacute' after I created a dtd file with all the entities that I found here http://www.w3.org/TR/xhtml1/dtds.html and I loaded it as follows XmlReaderSettings…
0xFF
  • 4,140
  • 7
  • 41
  • 58
0
votes
1 answer

HTML validation in Java

I try to write a HTML validator. At this time I considered the best way is to use a DTD File, because the Validator should complain, if interactive things, like JavaScript are used. Does anyone know a way, how i can validate a HTML file against a…
0
votes
1 answer

How to report a missing DTD files to the user?

Given the code : public class ModelHandler { //members private DocumentBuilderFactory m_domFactory; private DocumentBuilder m_builder; private Document m_doc; private XPathFactory m_factory; private List m_inputErrorLog; public void…
JAN
  • 21,236
  • 66
  • 181
  • 318
0
votes
0 answers

Validate xml document against external DTD

I need to validate external XML document against DTD, that's stored in my jar. But the problem is, that this document probably don't have
hades
  • 1,077
  • 3
  • 11
  • 19
0
votes
3 answers

Alternative to CDATA

I have a large XML file, in which every nodes requires a CDATA tag. my_id ... How to avoid to place CDATA in every node? Does…
Jorjon
  • 5,316
  • 1
  • 41
  • 58