From 960ee4a1856db8eadb96277bb2422edfa8f2a81c Mon Sep 17 00:00:00 2001 From: Gabriel Halley Date: Wed, 7 Oct 2015 23:11:24 -0400 Subject: removing whitespace all over --- xml.html.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'xml.html.markdown') diff --git a/xml.html.markdown b/xml.html.markdown index 059ea132..d407512d 100644 --- a/xml.html.markdown +++ b/xml.html.markdown @@ -38,10 +38,10 @@ Unlike HTML, XML does not specify how to display or to format data, just carry i @@ -54,8 +54,8 @@ Unlike HTML, XML does not specify how to display or to format data, just carry i 2 - Elements -> That's pure data. That's what the parser will retrieve from the XML file. Elements appear between the open and close tags. --> - - + + computer.gif @@ -68,14 +68,14 @@ A XML document is well-formated if it is syntactically correct. However, it is possible to inject more constraints in the document, using document definitions, such as DTD and XML Schema. -A XML document which follows a document definition is called valid, -regarding that document. +A XML document which follows a document definition is called valid, +regarding that document. With this tool, you can check the XML data outside the application logic. ```xml - -- cgit v1.2.3 From bb8eeb53ef01b6bfbdf64d6f1dc067f9cf4b8f8d Mon Sep 17 00:00:00 2001 From: Andy B Date: Fri, 9 Oct 2015 16:05:21 +0100 Subject: [xml/en] Grammar fixes --- xml.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xml.html.markdown') diff --git a/xml.html.markdown b/xml.html.markdown index d407512d..4d33e614 100644 --- a/xml.html.markdown +++ b/xml.html.markdown @@ -40,13 +40,14 @@ Unlike HTML, XML does not specify how to display or to format data, just carry i It starts with a declaration, informing some metadata (optional). XML uses a tree structure. Above, the root node is 'bookstore', which has - three child nodes, all 'books'. Those nodes has more child nodes, and so on... + three child nodes, all 'books'. Those nodes have more child nodes (or + children), and so on... - Nodes are created using open/close tags, and childs are just nodes between + Nodes are created using open/close tags, and children are just nodes between the open and close tags.--> - + + + + + + + +Content + + + + + + + + + + + + + + + + + + + + + + + Text + + + + + + + Text + + +Text +``` + +## An XML document +This is what makes XML versatile. It is human readable too. The following document tells us that it defines a bookstore which sells three books, one of which is Learning XML by Erik T. Ray. All this without having used an XML Parser yet. + +```xml + Everyday Italian @@ -36,85 +94,49 @@ Unlike HTML, XML does not specify how to display or to format data, it just carr 39.95 - - - - - - - - -computer.gif - - ``` -* Well-Formated Document x Validation - -An XML document is well-formatted if it is syntactically correct. -However, it is possible to inject more constraints in the document, -using document definitions, such as DTD and XML Schema. +## Well-formedness and Validation -An XML document which follows a document definition is called valid, -in regards to that document. - -With this tool, you can check the XML data outside the application logic. +A XML document is *well-formed* if it is syntactically correct. However, it is possible to add more constraints to the document, using Document Type Definitions (DTDs). A document whose elements are attributes are declared in a DTD and which follows the grammar specified in that DTD is called *valid* with respect to that DTD, in addition to being well-formed. ```xml - - - + - + + - Everyday Italian + Everyday Italian + Giada De Laurentiis + 2005 30.00 - - - - + + + + + ]> - - - - - + @@ -127,3 +149,18 @@ With this tool, you can check the XML data outside the application logic. ``` + +## DTD Compatibility and XML Schema Definitions + +Support for DTDs is ubiquitous because they are so old. Unfortunately, modern XML features like namespaces are not supported by DTDs. XML Schema Definitions (XSDs) are meant to replace DTDs for defining XML document grammar. + +## Resources + +* [Validate your XML](http://www.xmlvalidation.com) + +## Further Reading + +* [XML Schema Definitions Tutorial](http://www.w3schools.com/schema/) +* [DTD Tutorial](http://www.w3schools.com/xml/xml_dtd_intro.asp) +* [XML Tutorial](http://www.w3schools.com/xml/default.asp) +* [Using XPath queries to parse XML](http://www.w3schools.com/xml/xml_xpath.asp) -- cgit v1.2.3