Skip to content

Instantly share code, notes, and snippets.

@roorz
roorz / KeePassToSafeInCloud.py
Created July 24, 2012 18:53
Kee Pass to Safe In Cloud XML
from StringIO import StringIO
from lxml import etree
import os
import sys
if (len(sys.argv) > 1):
srcFile = os.path.abspath(sys.argv[1])
if (not os.path.exists(srcFile)):
print "File '" + srcFile + "' not found."
sys.exit(0)
@roorz
roorz / XSLTransform.py
Created July 24, 2012 18:32
Python XSLT Transformation
from StringIO import StringIO
from lxml import etree
xslt_root = etree.XML('''\
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<foo><xsl:value-of select="/a/b/text()" /></foo>
</xsl:template>
</xsl:stylesheet>''')