From 91b91a867d7a2d79d024eb00ff67463d813cf66e Mon Sep 17 00:00:00 2001 From: rzaitov Date: Thu, 14 Nov 2013 20:00:41 +0400 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D1=8F?= =?UTF-8?q?=D1=8E=20=D0=BD=D0=B0=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B8?= =?UTF-8?q?=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20?= =?UTF-8?q?=D1=81=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BE=D0=B9=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20xml=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/TouchinBuild/XmlTest.py | 18 ++++++++++++++++++ scripts/TouchinBuild/data.xml | 6 ++++++ scripts/TouchinBuild/output.xml | 6 ++++++ 3 files changed, 30 insertions(+) create mode 100644 scripts/TouchinBuild/XmlTest.py create mode 100644 scripts/TouchinBuild/data.xml create mode 100644 scripts/TouchinBuild/output.xml diff --git a/scripts/TouchinBuild/XmlTest.py b/scripts/TouchinBuild/XmlTest.py new file mode 100644 index 0000000..0334673 --- /dev/null +++ b/scripts/TouchinBuild/XmlTest.py @@ -0,0 +1,18 @@ +import xml.etree.ElementTree as eT + +androidNs = 'http://schemas.android.com/apk/res/android' +eT.register_namespace('android', androidNs) + +tree = eT.parse('data.xml') +root = tree.getroot() + +print root.attrib + +root.set('myAtr', 'myValue') +root.set('{{{0}}}myAtr'.format(androidNs), '777') +root.set('android:MyAttribute', 'Rustam') + +tree.write('output.xml', xml_declaration=True, encoding='utf-8', method="xml") + +print root.tag + diff --git a/scripts/TouchinBuild/data.xml b/scripts/TouchinBuild/data.xml new file mode 100644 index 0000000..a43bb09 --- /dev/null +++ b/scripts/TouchinBuild/data.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/scripts/TouchinBuild/output.xml b/scripts/TouchinBuild/output.xml new file mode 100644 index 0000000..c0bf2c6 --- /dev/null +++ b/scripts/TouchinBuild/output.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file