XML documents must adhere to certain rules to be well formed. : Well Formed « Introduction « XML Tutorial

XML Tutorial
1. Introduction
2. Namespace
3. XML Schema
4. XPath
5. XSLT stylesheet
Java
XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
XML Tutorial » Introduction » Well Formed 
1. 3. 1. XML documents must adhere to certain rules to be well formed.
Every start-tag must have a matching end-tag, or be a self-closing tag. 
Every element must have a closing tag. 
Empty tags can either use an all-in-one opening and closing tag with a slash before the final > or a separate closing tag.

<?xml version="1.0" ?>
<animal>
    <name>T1</name>
    <picture filename="tiger.jpg"/>
</animal>

Tags can't overlap and elements must be properly nested. 
XML documents can have only one root element. 
The only pieces of XML allowed outside (precedingthe root element are comments and processing instructions.

<?xml version="1.0" ?>
<animal>
    <name>T1</name>
</animal>

Element names must obey XML naming conventions. 
XML is case sensitive. 
The namel, Name, and NAME elements are considered completely separate and unrelated.

<name>T1</name>
<Name>T1</Name>
<NAME>T1</NAME>
1. 3. Well Formed
1. 3. 1. XML documents must adhere to certain rules to be well formed.
1. 3. 2. XML Naming Conventions
1. 3. 3. Case Sensitivity
1. 3. 4. Writing Non-Empty Elements
1. 3. 5. Nesting Elements
1. 3. 6. Empty Elements
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.