![]() |
|
| • All Online Courses • New Courses • QuickTips • Word Definitions • Submit a Tutorial • Links • |
|
Learn XML programming in this free XML training course What about mixed content? How is it used and handled?Mixed content in DTD’s can present problems, but luckily the problems are easily avoidable. All that it takes is the use of DTD element definitions to set up rules for how the content should be handled. Consider the following scenario. You’re defining the cats element, but in some instances there is just going to be a string of text and in others there will be clustered elements to go along with it. This could cause problems, because most programs will be expecting either one or the other… unless they know that it’s coming beforehand. That’s where your list of repeating elements comes into play. Consider the following code: <!ELEMENT cats (name+)> What you’re seeing here is the definition for the element, cats. When your program reaches cats, it sees that there is going to be one or more instances of the element name inside of cats. (Remember the previous listing… that’s what the + means.) When it gets to name, then, it sees that name can either consist of a string of text, or an instance of the element, color. Color, then, is defined as a string of text… though it doesn’t have to appear in the place of name, since it has a definition all its own. Of course, color could be defined in other ways… perhaps you want to have a picture appear, or have a more complex element. Maybe color will have several options available to it, as well. If you wanted, you could create a separate element for each possible color, and have all of them listed as options for the color element. It’s entirely up to you.
by John Casteele Find more free Internet tutorials from Learnthat.com. More Information:
Help us by rating this tutorial: [---] [--] [+] [++] [+++] [---] lowest; [+++] highest
|
|
||||||
![]() |
Learn: Free
Tutorials - Links
to Free Tutorials
Understand: Free Technical Definitions
- ExplainThat Whitepapers
Use: Certification Section -
Discussion Forum
Visit Our Network Sites:
About Us : Contact Us : Advertise : Privacy Information