Learnthat.com Free Certification and Computer Online Courses
ThatNetwork.com Internet Media Network Exampractice.com free certification practice exams, mcse, comptia Definethat.com - Free technical definitions, define Free Romance Tips, Romantic Tips, Date Ideas Free POD publisher comparison print on demand
Learnthat.com Free A+ Certification, Computer Classes, Certification Courses, Business, Lifestyle, ApplicationsFree business tutorials and definitionsFree certification tutorials and definitionsFree computer and technical tutorials and technical definitionsFree Finance Tutorials and DefinitionsFree House Repair TutorialsFree Lifestyle and Fun Tutorials
  All Online CoursesNew Courses QuickTipsWord DefinitionsSubmit a TutorialLinks
÷ Resources
Home
free tech tutorials
Free Tutorials
free tech tutorials
Certifications
free tech tutorials
Definitions
free tech tutorials
Resources/Links
free tech tutorials
Forums
free tech tutorials
Distance Education
free tech tutorials
Highest Rated Tutorials
÷ Popular Tutorials
÷ New Tutorials

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+)>
            <!ELEMENT name (#PCDATA | color)*>
            <!ELEMENT color (#PCDATA)>

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, colorColor, 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:

DefineThat.com Technical Defintions Romancetips.com
Free Gift Ideas - GiveThat Planthat.com Free Unique Business Ideas
PublishOnDemand.net - Learn about Print on Demand (POD) - Self Publishing Seekthat.com - Technical Search Engine
ThatNetwork.com  

About Us : Contact Us : Advertise : Privacy Information

© 1998-2004 Learnthat.com