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

 

How do I structure my XML documents?

Structure in an XML document is very important.  Small errors in the structure of your document can have large effects on the overall outcome; pieces may not be displayed correctly, or might not appear at all.  If the structure is too damaged, then the entire document might fail to work.

So what is the proper method of structuring an XML document?

As previously mentioned, all XML documents begin with the XML directive.  Open up the previously-saved file, cats.xml, and you’ll find your directive already in place.

<?xml version=”1.0”?>

<cats>Tooter and Shade are the best cats in the world!</cats>

Unfortunately, your file is still missing a few vital elements.  The <cats> tags don’t work, and the browser has no idea how to make them work.  If you load it up in a browser, you’ll just see a copy of the file, with the various elements in different colors.  This is actually useful, however; as long as you see this, then your code is good.  The browser doesn’t know what else to do with it, in this case because some of the elements are missing, but the lack of definitive error codes tells you that it’s at least well-coded.

Go into the file, between your directive and the content, and get ready to add another vital element to your page.  Type the following:

<?xml-stylesheet type=”text/css” href=”cats.css”?>

Of course, this doesn’t mean much to you right now… in time, though, it’s going to be a vital part of your page.  What you just typed is the directions that the browser needs to find the XML processor, or the file that tells it how it should handle the information in the XML document.  The line that you just typed tells the browser to find the file called cats.css, and that the file is a Cascading Style Sheet.  It also tells it that it’s the stylesheet that it needs for this page.

Now your cats.xml file should look like the following, which looks a lot more like an XML file.

<?xml version=”1.0”?>

<?xml-stylesheet type=”text/css” href=”cats.css”?>

<cats>Tooter and Shade are the best cats in the world!</cats>

Of course, you’ve still got to define cats.css, but that can wait.  You still have to learn a little bit more about XML first… namely the use of elements and attributes.  Go ahead and save your cats.xml file, and then we can look at what elements and attributes are.

 

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