User:Jarle Pahr/XML: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
Line 21: Line 21:


https://wiki.python.org/moin/MiniDom
https://wiki.python.org/moin/MiniDom


==lXML==
==lXML==
Line 30: Line 29:


http://infohost.nmt.edu/tcc/help/pubs/pylxml/web/index.html
http://infohost.nmt.edu/tcc/help/pubs/pylxml/web/index.html
The packages ElementTree and lxml uses an "Element Tree" view of .xml files differing from the Document Object Model (DOM).
The Element class in lxml contains the following attributes:
*.tag: The name of the element.
*.text: The text inside the element, up to the first child element. Equals None if no text.
*.tail: The text following the element.
*.attrib: Python dictionary with the elements attributes and their values.


Seee also:
Seee also:

Revision as of 06:55, 9 January 2014

Notes on Extensible Markup Language (XML): https://en.wikipedia.org/wiki/XML


http://stackoverflow.com/questions/3536893/what-are-the-pros-and-cons-of-xml-and-json



XML in Python

https://wiki.python.org/moin/PythonXml

http://docs.python.org/2/library/xml.etree.elementtree.html#module-xml.etree.ElementTree

http://www.boddie.org.uk/python/XML_intro.html

http://stackoverflow.com/questions/1912434/how-do-i-parse-xml-in-python

http://oreilly.com/catalog/pythonxml/chapter/ch01.html

https://wiki.python.org/moin/MiniDom

lXML

https://pypi.python.org/pypi/lxml

http://lxml.de/3.3/lxmldoc-3.3.0beta3.pdf

http://infohost.nmt.edu/tcc/help/pubs/pylxml/web/index.html


The packages ElementTree and lxml uses an "Element Tree" view of .xml files differing from the Document Object Model (DOM).

The Element class in lxml contains the following attributes:

  • .tag: The name of the element.
  • .text: The text inside the element, up to the first child element. Equals None if no text.
  • .tail: The text following the element.
  • .attrib: Python dictionary with the elements attributes and their values.


Seee also:

  • SBML
  • JSON