Difference between revisions of "XML"

From Fab Lab Bcn WIKI
Jump to: navigation, search
(Example)
(XML editors)
 
(14 intermediate revisions by one user not shown)
Line 1: Line 1:
'''Extensible Markup Language''' ('''XML''') is a set of rules for encoding documents in [[machine-readable]] form. It is defined in the XML 1.0 Specification<ref>{{cite web|url=http://www.w3.org/TR/REC-xml |title=XML 1.0 Specification |publisher=W3.org |date= |accessdate=2010-08-22}}</ref> produced by the [[W3C]], and several other related specifications, all [[gratis]] [[open standard]]s.<ref>{{cite web|title=W3C DOCUMENT LICENSE|url=http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231}}</ref>
+
'''Extensible Markup Language''' ('''XML''') is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards.
  
The design goals of XML emphasize simplicity, generality, and usability over the [[Internet]].<ref name="XML Goals">{{cite web|title=XML 1.0 Origin and Goals|url=http://www.w3.org/TR/REC-xml/#sec-origin-goals|accessdate=July 2009}}</ref> It is a textual data format with strong support via [[Unicode]] for the languages of the world. Although the design of XML focuses on documents, it is widely used for the representation of arbitrary [[data structures]], for example in [[web service]]s.
+
The design goals of XML emphasize simplicity, generality, and usability over the Internet. It is a textual data format with strong support via Unicode for the languages of the world. Although the design of XML focuses on documents, it is widely used for the representation of arbitrary data structures, for example in web services.
  
Many [[application programming interfaces]] (APIs) have been developed that software developers use to process XML data, and several [[XML schema|schema systems]] exist to aid in the definition of XML-based languages.
+
Many application programming interfaces (APIs) have been developed that software developers use to process XML data, and several XML schema exist to aid in the definition of XML-based languages.
  
 
= Edit and create =
 
= Edit and create =
 +
Most built-in plain text editors like Notepad in Windows or TextEdit in Mac are able to open and edit XML files, however this is not a good solution when you need to edit large amounts of information.
  
= Parsing =
+
== General purpose spreadsheet tools ==
 +
* Microsoft Excel
 +
* Libre Office http://www.libreoffice.org/download (free)
 +
* Open Office http://www.openoffice.org/ (free)
  
== Processing ==
+
== General purpose text/code editors ==
 +
=== Mac ===
 +
*TextWrangler http://www.barebones.com/products/TextWrangler/
 +
*Kod http://kodapp.com/
 +
*Apple Xcode. (For Mac OS X 10.6 and older register and download it from http://developer.apple.com/. For mac 10.7 go to the App Store. You can also install it from your Mac setup DVD's)
  
=== Example ===
+
=== Win ===
* http://processing.org/reference/XMLElement.html
+
*NotePad http://notepad-plus-plus.org/
 +
* Microsoft Visual Studio http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express
  
 +
== XML editors ==
 +
*Microsoft XML Notepad http://www.microsoft.com/download/en/details.aspx?id=7973
 +
*Serna XML Editor http://www.syntext.com/products/serna-free/
 +
*Xmplify http://xmplifyapp.com/ (commercial)
  
The following short XML file called "sites.xml" is parsed
+
== Google Docs ==
in the code below. It must be in the project's "data" directory
+
Google docs https://docs.google.com have a spreadsheet tool. However they do not offer native XML on their visual interface you can retrieve any spreadsheet you create in XML using its API http://code.google.com/apis/spreadsheets/data/3.0/reference.html
  
<?xml version="1.0"?>
+
*Tutorial http://blog.blprnt.com/blog/blprnt/open-science-h1n1-processing-and-the-google-spreadsheet-api
<websites>
+
<site id="0" url="processing.org">Processing</site>
+
<site id="1" url="mobile.processing.org">Processing Mobile</site>
+
</websites>
+
  
<code>
+
= Parsing =
XMLElement xml;
+
  
void setup() {
+
== Processing ==
  size(200, 200);
+
* http://processing.org/reference/XMLElement.html
  xml = new XMLElement(this, "sites.xml");
+
  int numSites = xml.getChildCount();
+
  for (int i = 0; i < numSites; i++) {
+
    XMLElement kid = xml.getChild(i);
+
    int id = kid.getInt("id");
+
    String url = kid.getString("url");
+
    String site = kid.getContent();
+
    println(id + " : " + url + " : " + site);   
+
  }
+
}
+
</code>
+

Latest revision as of 01:27, 8 December 2011

Extensible Markup Language (XML) is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards.

The design goals of XML emphasize simplicity, generality, and usability over the Internet. It is a textual data format with strong support via Unicode for the languages of the world. Although the design of XML focuses on documents, it is widely used for the representation of arbitrary data structures, for example in web services.

Many application programming interfaces (APIs) have been developed that software developers use to process XML data, and several XML schema exist to aid in the definition of XML-based languages.

Edit and create

Most built-in plain text editors like Notepad in Windows or TextEdit in Mac are able to open and edit XML files, however this is not a good solution when you need to edit large amounts of information.

General purpose spreadsheet tools

General purpose text/code editors

Mac

Win

XML editors

Google Docs

Google docs https://docs.google.com have a spreadsheet tool. However they do not offer native XML on their visual interface you can retrieve any spreadsheet you create in XML using its API http://code.google.com/apis/spreadsheets/data/3.0/reference.html

Parsing

Processing