ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: XML :: XML µÄÓÐЧÐÔÑéÖ¤

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

XML
XML DHTMLÐÐΪ
XML Ïà¹Ø¼¼Êõ
XML ±à¼­Æ÷
XML ÕªÒª
XML ʵÀý
XML×Ö·û±àÂë
xml ÎĵµÊ÷
IEºÍ»ðºü¶ÁÈ¡XML·..

XML µÄÓÐЧÐÔÑéÖ¤


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-29 ÐÞ¸Ä:2008-04-05 ä¯ÀÀ:5983 :: ::

XML with correct syntax is Well Formed XML.
ʹÓÃÕýÈ·µÄÓï·¨¿ÉÒÔʹXMLµÄ¸ñʽ±ê×¼»¯¡£

XML validated against a DTD is Valid XML.
¾­¹ýDTDÑéÖ¤µÄXMLÊÇÓÐЧµÄXML¡£


Well Formed XML Documents
¸ñʽ±ê×¼µÄXMLÎĵµ

A "Well Formed" XML document has correct XML syntax.
¸ñʽ±ê×¼µÄXMLÎĵµ°üº¬ÕýÈ·µÄXMLÓï·¨¹æÔò¡£

A "Well Formed" XML document is a document that conforms to the XML syntax rules that were described in the previous chapters:
ÕýÈçǰ¼¸ÕÂÖÐËùÌáµ½¹ýµÄÄÇÑù£¬·ûºÏXMLÓï·¨¹æÔòµÄXML²ÅÄÜËãÊǸñʽ±ê×¼µÄXML£º

  • XML documents must have a root element
    XMLÎļþ±ØÐëÓиùÔªËØ
  • XML elements must have a closing tag
    XMLÔªËØ±ØÐëÓнáÊø±êÇ©
  • XML tags are case sensitive
    XML±êÇ©Çø·Ö×Öĸ´óСд
  • XML elements must be properly nested
    XMLÔªËØ±ØÐëǶÌ׺ÏÀí
  • XML attribute values must always be quoted
    XMLÊôÐÔÖµ±ØÐëдÔÚÒýºÅÄÚ
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>

<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

Valid XML Documents
ÓÐЧµÄXMLÎĵµ

A "Valid" XML document also conforms to a DTD.
Ò»·Ý“ÓÐЧ”µÄXMLÎĵµ»¹µÃ·ûºÏ DTD ¹æÔò¡£

A "Valid" XML document is a "Well Formed" XML document, which also conforms to the rules of a Document Type Definition (DTD):
·ûºÏDTD¹æÔòµÄXMLÎĵµ²ÅÊǸñʽÕýÈ·µÄXMLÎĵµ£º

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE note SYSTEM "InternalNote.dtd">
<note>
<to>Tove</to>

<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

XML DTD

A DTD defines the legal elements of an XML document.
DTDÏêϸ¶¨ÒåÁËXMLÎļþÖеĺϷ¨ÔªËØ¡£

The purpose of a DTD is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements. You can read more about DTD, and how to validate your XML documents in our DTD tutorial.
DTDµÄÄ¿µÄ¾ÍÊǶ¨ÒåÒ»·ÝXMLÎĵµÖеĺϷ¨Çø¿é¡£Ëü¶¨ÒåÁËһϵÁкϷ¨ÔªËØ¡£ÔÚÎÒÃǵÄDTD½Ì³ÌÖУ¬Äã¿ÉÒÔÁ˽â¸ü¶à¹ØÓÚDTDµÄÄÚÈÝ£¬ÒÔ¼°ÑéÖ¤XMLÎĵµÓÐЧÐÔµÄfang¡£


XML Schema 
XML Schema

XML Schema is an XML based alternative to DTD.
XML Schema ÊÇ»ùÓÚXMLµÄ£¬ËüÊÇDTDµÄÁíÒ»¸öÌæ»»·½Ê½¡£

W3C supports an alternative to DTD called XML Schema. You can read more about XML Schema in our Schema tutorial.
W3CÖ§³ÖDTDµÄÁíÒ»¸öÌæ»»·½Ê½£¬ÎÒÃdzÆÖ®Îª XML Schema¡£ÔÚSchema ½Ì³ÌÖУ¬Äã¿ÉÒÔѧϰµ½¹ØÓÚ XML Schema µÄ¸ü¶àÄÚÈÝ¡£


A General XML Validator
ͨÓÃXMLУÑéÆ÷

To help you check the syntax of your xml files, we have created this link so that you can syntax-check any XML file.
ΪÁ˰ïÖúÄã¼ì²éXMLÎļþÓï·¨µÄÕýÈ·ÐÔ£¬ÎÒÃÇÉèÖÃÁË ¹ØÓÚXMLÎļþÓï·¨¹æÔòУÑé µÄÁ´½Ó£¬¿ÉÄܶÔÄãÓÐËù°ïÖú¡£

ÆÀÂÛ (1) 1 All