Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8

Thread: XML question

  1. #1
    Junior Member
    Join Date
    Jan 2004
    Posts
    1
    Member #
    4542
    Hey

    I'm posting here for the first time with a question regarding an XML definition that i need for a college course. Basically, i just needed a clear definition for what a "well formed document" is in terms of XML syntax. If I need to narrow my question down any, then just say so.

    Or, just link me to EarthwormJim's thread. :cheeky:

  2.  

  3. #2
    Senior Member nsr81's Avatar
    Join Date
    Oct 2002
    Posts
    1,132
    Member #
    250
    Liked
    15 times
    Few pointers from www.w3schools.com which tell you what should be done to make a document well-formed:

    - XML elements must be properly nested
    - All XML documents must have a root element
    - Attribute values must always be quoted
    - Tag names must be in lowercase
    - All XML elements must be closed

    Comments and corrections welcomed
    There and Back Again :Ogre:

  4. #3
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    XML element can be closed on the same line:
    Code:
    <element />
    Well formed doesn't mean readable. Data structures spanning 2 heirarchical levels have issues:
    Code:
    <stuff>
        <home>
            <kitchen>
                <phone />
            </kitchen>
        </home>
        <car>
            <phone />
        </car>
    </stuff>
    Phone presents a little bit of an issue.

  5. #4
    Senior Member karinne's Avatar
    Join Date
    Dec 2003
    Location
    Aylmer QC Canada
    Posts
    1,607
    Member #
    4335
    Liked
    8 times
    [a web design portfolio - Currently NOT AVAILABLE for work | web design | Re-coding | PSD-to-HTML]
    I'm also on: virb - facebook - twitter - flickr - del.icio.us

  6. #5
    Senior Member Riat_Sila's Avatar
    Join Date
    Oct 2003
    Location
    Berkshire, UK
    Posts
    417
    Member #
    3485
    ASCII must be specified with entities;
    Markup characters such as '&' cannot be used as element names or attributes;

  7. #6
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Originally posted by Riat_Sila
    Markup characters such as '&' cannot be used as element names or attributes;
    ampersand, greater than, and quote, specifically. Use &amp;amp; &amp;gt; and &amp;quot; instead

  8. #7
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    More generally, you should follow basic HTML rules when writing XML (notice the trend of quoting attributes, using entities, etc...all are present in HTML and, of course, XHTML).
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  9. #8
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    That's not quite true, filb. HTML was created before XML. It is a markup language, but not bound by all the rules that XML must conform to strictly.

    XHTML is an attempt to make a version of HTML that conforms to XML standards and is still usable by browsers.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:27 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com