Understanding XML DTD with a sample code An XML DTD is the document that defines how an XML document should look like. You can think of a DTD as an outline or a rule that should be followed in creating an XML document. The number of nodes and child nodes are defined for a particular tag in an XML document. If you know how to create or read a DTD document then you can create an XML document based on that DTD. Knowledge on DTD would help you to find out what went wrong in an XML document if that document fails the validation. Consider the following DTD document: <!ELEMENT freeSoftware ( download+ ) > In the above code in the DTD, you can understand that the XML document created based on that would have one or more <download> elements. Each of these <download> element would have one <productName> child node and one or more <link> child node. The '+' sign indicates that the node can be present one or more times.
|
|
||
|
|||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.