diff options
| author | Adam <adam@adambard.com> | 2015-10-19 14:28:03 +0800 | 
|---|---|---|
| committer | Adam <adam@adambard.com> | 2015-10-19 14:28:03 +0800 | 
| commit | e6573af645792cb434a16440f60cce8935fea95c (patch) | |
| tree | a3ac540a41f977dcbda046c8faa332cd8864f2b3 /xml.html.markdown | |
| parent | 6af01029e450fd2f82f0d056806ccb63a6e48ec9 (diff) | |
| parent | ba5f3ebc112b52797a9a21fdbba1846885feac2c (diff) | |
Merge branch 'master' of github.com:adambard/learnxinyminutes-docs
Diffstat (limited to 'xml.html.markdown')
| -rw-r--r-- | xml.html.markdown | 35 | 
1 files changed, 19 insertions, 16 deletions
| diff --git a/xml.html.markdown b/xml.html.markdown index fce1a3a4..b95d6088 100644 --- a/xml.html.markdown +++ b/xml.html.markdown @@ -3,11 +3,12 @@ language: xml  filename: learnxml.xml  contributors:    - ["João Farias", "https://github.com/JoaoGFarias"] +  - ["Rachel Stiyer", "https://github.com/rstiyer"]  ---  XML is a markup language designed to store and transport data. -Unlike HTML, XML does not specify how to display or to format data, just carry it. +Unlike HTML, XML does not specify how to display or to format data, it just carries it.  * XML Syntax @@ -38,23 +39,25 @@ Unlike HTML, XML does not specify how to display or to format data, just carry i  <!-- Above is a typical XML file.    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...  -   -  Nodes are created using open/close tags, and childs are just nodes between +  three child nodes, all 'books'. Those nodes have more child nodes (or +  children), and so on... + +  Nodes are created using open/close tags, and children are just nodes between    the open and close tags.--> -<!-- XML carries two kind of data: +<!-- XML carries two kinds of data:    1 - Attributes -> That's metadata about a node.        Usually, the XML parser uses this information to store the data properly. -      It is characterized by appearing in parenthesis within the opening tag +      It is characterized by appearing with the format name="value" within the opening +      tag.    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, without parenthesis. --> -       -   +      Elements appear between the open and close tags. --> + +  <!-- Below, an element with two attributes -->  <file type="gif" id="4293">computer.gif</file> @@ -63,25 +66,25 @@ Unlike HTML, XML does not specify how to display or to format data, just carry i  * Well-Formated Document x Validation -A XML document is well-formated if it is syntactically correct. +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. -A XML document which follows a document definition is called valid,  -regarding that document.  +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.  ```xml -<!-- Below, you can see an simplified version of bookstore document,  +<!-- Below, you can see an simplified version of bookstore document,    with the addition of DTD definition.-->  <?xml version="1.0" encoding="UTF-8"?>  <!DOCTYPE note SYSTEM "Bookstore.dtd">  <bookstore>    <book category="COOKING"> -    <title >Everyday Italian</title> +    <title>Everyday Italian</title>      <price>30.00</price>    </book>  </bookstore> @@ -119,7 +122,7 @@ With this tool, you can check the XML data outside the application logic.  <bookstore>    <book category="COOKING"> -    <title >Everyday Italian</title> +    <title>Everyday Italian</title>      <price>30.00</price>    </book>  </bookstore> | 
