Laboratorium XML
wtorek 11.00—12.30
»Home
»Materiały
  »DTD & co.
  »SAX
  »DOM
  »Zadanie 2
  »XPath
  »XSLT
  »Simple
  »JDOM
  »JS
»Odnośniki
  »Xerces2
»Zadania

Nowiny

Języki XML i okolice

Python

  • lxmlpythonic binding for the libxml2 and libxslt libraries, follows ElementTree API as much as possible.

    lxml 1.0 also contains HTMLParser for parsing (broken) HTML (using libxml2).

  • web.py — Simple and clear API for Python Web applications

  • instalacja lxml i web.py (ostatecznie 920K, szczytowo w czasie kompilacji 3.9M)

    mkdir -p ~/local/src
    export PYTHONPATH=~/local/share/python2.4/site-packages/:~/local/lib/python2.4/site-packages
    
    # installing Pyrex (required by lxml to compile)
    cd ~/local/src
    wget http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/Pyrex-0.9.4.1.tar.gz
    tar -zxf Pyrex-0.9.4.1.tar.gz
    cd Pyrex-0.9.4.1/
    python setup.py install --prefix ~/local
    cd .. && rm -r Pyrex-0.9.4.1 # saving place
    
    # installing
    cd ~/local/src
    wget http://codespeak.net/lxml/lxml-0.9.1.tgz
    tar -zxf lxml-0.9.1.tgz
    cd lxml-0.9.1
    python setup.py install --prefix ~/local
    cd .. && rm -r lxml-0.9.1 # 3.9M
    
    cd /home/pracown/lpankows/local/lib/python2.4/site-packages/
    wget http://webpy.org/web.py
    
    # 2,6M left
    # we can remove sources and Pyrex living only ~/local/lib with lxml and web.py
    rm -r ~/local/bin/ ~/local/share/ ~/local/src
    # this leaves 920K