|
|
| | There are, however, other text “formats” that ''do'' impose a structure over the included data. One such format is called XML (short for ''e'''X'''tensible '''M'''arkup '''L'''anguage''). This page seeks to introduce you to this type of text information. | | There are, however, other text “formats” that ''do'' impose a structure over the included data. One such format is called XML (short for ''e'''X'''tensible '''M'''arkup '''L'''anguage''). This page seeks to introduce you to this type of text information. |
| | | | |
| − | === Overall Concept ===
| + | == Overall Concept == |
| | | | |
| | The core idea behind XML data is that the information inside it can be thought of as an ''outline'' or ''tree''. Our own wiki pages have outlines, in the form of either sections or bulleted lists: | | The core idea behind XML data is that the information inside it can be thought of as an ''outline'' or ''tree''. Our own wiki pages have outlines, in the form of either sections or bulleted lists: |
|
|
| | Even now, you might already be seeing a pattern in terms of how the XML looks and what outline it represents. That’s one of the intentions of XML: it’s meant to strike a balance between ''human readability'' and ''machine readability''. The “human readability” part manifests in recognizable words (“name,” “lineage,” “taxon”), while “machine readability” comes in through some special symbols and rules. | | Even now, you might already be seeing a pattern in terms of how the XML looks and what outline it represents. That’s one of the intentions of XML: it’s meant to strike a balance between ''human readability'' and ''machine readability''. The “human readability” part manifests in recognizable words (“name,” “lineage,” “taxon”), while “machine readability” comes in through some special symbols and rules. |
| | | | |
| − | === Specific Parts ===
| + | == Specific Parts == |
| | | | |
| | An XML file consists of three primary parts, each expressed in a very specific manner. | | An XML file consists of three primary parts, each expressed in a very specific manner. |
| | | | |
| − | ==== Tags ====
| + | === Tags === |
| | | | |
| | ''Tags'' serve to delineate the outlined “sections” of XML data. They serve the same function as bullets or section numbers in the more familiar outlines that we know. Whereas humans are generally capable of figuring out where a heading or bullet item starts and ends, computers need more help. Thus, tags also explicitly state when an XML “section” ends. | | ''Tags'' serve to delineate the outlined “sections” of XML data. They serve the same function as bullets or section numbers in the more familiar outlines that we know. Whereas humans are generally capable of figuring out where a heading or bullet item starts and ends, computers need more help. Thus, tags also explicitly state when an XML “section” ends. |
|
|
| | Hope you can see why this shortcut is viewed to be pretty useful ''':)''' | | Hope you can see why this shortcut is viewed to be pretty useful ''':)''' |
| | | | |
| − | ==== Content ====
| + | === Content === |
| | | | |
| | Tags by themselves hint at the ''structure'' of XML data, but not the actual ''information'' within. For example, here’s an XML representation for contact information: | | Tags by themselves hint at the ''structure'' of XML data, but not the actual ''information'' within. For example, here’s an XML representation for contact information: |
|
|
| | Thus, tags either have plain text content in them, or other tags. Never both. | | Thus, tags either have plain text content in them, or other tags. Never both. |
| | | | |
| − | ==== Attributes ====
| + | === Attributes === |
| | | | |
| | An alternative way to provide specific information in an XML file is through ''attributes''. An attribute is a ''name="value"'' expression that is included ''inside'' a start or standalone tag: | | An alternative way to provide specific information in an XML file is through ''attributes''. An attribute is a ''name="value"'' expression that is included ''inside'' a start or standalone tag: |
|
|
| | When should something be an attribute vs. content? There are no hard-and-fast rules. The general approach, though, is that an attribute is information ''about'' the content in the tag, while the content is, well, the information of the tag itself. | | When should something be an attribute vs. content? There are no hard-and-fast rules. The general approach, though, is that an attribute is information ''about'' the content in the tag, while the content is, well, the information of the tag itself. |
| | | | |
| − | === The XML Schema ===
| + | == The XML Schema == |
| | | | |
| | In this page, you’ve seen two types of XML examples: one that looks like it holds gene, protein, or organism information of some sort, and another one that looks like a typical address book. How do you know what the tags mean? This is where the XML ''schema'' comes in. An XML schema is a separate document that explains the tags and attributes for a particular type of XML document. We won’t go into too much detail about the XML schema at this point, but suffice it to say that such things exist, so that readers of a particular XML file have an authoritative source for what the tags and attributes within that file might mean. | | In this page, you’ve seen two types of XML examples: one that looks like it holds gene, protein, or organism information of some sort, and another one that looks like a typical address book. How do you know what the tags mean? This is where the XML ''schema'' comes in. An XML schema is a separate document that explains the tags and attributes for a particular type of XML document. We won’t go into too much detail about the XML schema at this point, but suffice it to say that such things exist, so that readers of a particular XML file have an authoritative source for what the tags and attributes within that file might mean. |
|
|
| | More to come on the schema; for now, it’s hoped that you can at least scan some XML information and get an idea of the outline that it provides. | | More to come on the schema; for now, it’s hoped that you can at least scan some XML information and get an idea of the outline that it provides. |
| | | | |
| − | === The Concept’s the Thing ===
| + | == The Concept’s the Thing == |
| | | | |
Unexpected non-MediaWiki exception encountered, of type "Error"
Error: Call to undefined function each() in /apps/xmlpipedb/biodb/fall2013/includes/diff/DairikiDiff.php:374
Stack trace:
#0 /apps/xmlpipedb/biodb/fall2013/includes/diff/DairikiDiff.php(480): _DiffEngine->_diag()
#1 /apps/xmlpipedb/biodb/fall2013/includes/diff/DairikiDiff.php(291): _DiffEngine->_compareseq()
#2 /apps/xmlpipedb/biodb/fall2013/includes/diff/DairikiDiff.php(175): _DiffEngine->diff_local()
#3 /apps/xmlpipedb/biodb/fall2013/includes/diff/DairikiDiff.php(653): _DiffEngine->diff()
#4 /apps/xmlpipedb/biodb/fall2013/includes/diff/DairikiDiff.php(820): Diff->__construct()
#5 /apps/xmlpipedb/biodb/fall2013/includes/diff/DairikiDiff.php(1240): MappedDiff->__construct()
#6 /apps/xmlpipedb/biodb/fall2013/includes/diff/DairikiDiff.php(1458): WordLevelDiff->__construct()
#7 /apps/xmlpipedb/biodb/fall2013/includes/diff/DairikiDiff.php(952): TableDiffFormatter->_changed()
#8 /apps/xmlpipedb/biodb/fall2013/includes/diff/DairikiDiff.php(895): DiffFormatter->_block()
#9 /apps/xmlpipedb/biodb/fall2013/includes/diff/DifferenceEngine.php(765): DiffFormatter->format()
#10 /apps/xmlpipedb/biodb/fall2013/includes/diff/DifferenceEngine.php(655): DifferenceEngine->generateDiffBody()
#11 /apps/xmlpipedb/biodb/fall2013/includes/diff/DifferenceEngine.php(593): DifferenceEngine->getDiffBody()
#12 /apps/xmlpipedb/biodb/fall2013/includes/diff/DifferenceEngine.php(566): DifferenceEngine->getDiff()
#13 /apps/xmlpipedb/biodb/fall2013/includes/diff/DifferenceEngine.php(409): DifferenceEngine->showDiff()
#14 /apps/xmlpipedb/biodb/fall2013/includes/Article.php(725): DifferenceEngine->showDiffPage()
#15 /apps/xmlpipedb/biodb/fall2013/includes/Article.php(478): Article->showDiffPage()
#16 /apps/xmlpipedb/biodb/fall2013/includes/actions/ViewAction.php(37): Article->view()
#17 /apps/xmlpipedb/biodb/fall2013/includes/Wiki.php(427): ViewAction->show()
#18 /apps/xmlpipedb/biodb/fall2013/includes/Wiki.php(304): MediaWiki->performAction()
#19 /apps/xmlpipedb/biodb/fall2013/includes/Wiki.php(536): MediaWiki->performRequest()
#20 /apps/xmlpipedb/biodb/fall2013/includes/Wiki.php(446): MediaWiki->main()
#21 /apps/xmlpipedb/biodb/fall2013/index.php(59): MediaWiki->run()
#22 {main}