diff options
Diffstat (limited to 'testing/web-platform/tests/tools/py/doc/example/genxml.py')
-rw-r--r-- | testing/web-platform/tests/tools/py/doc/example/genxml.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/py/doc/example/genxml.py b/testing/web-platform/tests/tools/py/doc/example/genxml.py new file mode 100644 index 000000000..5f754e889 --- /dev/null +++ b/testing/web-platform/tests/tools/py/doc/example/genxml.py @@ -0,0 +1,17 @@ + +import py +class ns(py.xml.Namespace): + pass + +doc = ns.books( + ns.book( + ns.author("May Day"), + ns.title("python for java programmers"),), + ns.book( + ns.author("why", class_="somecssclass"), + ns.title("Java for Python programmers"),), + publisher="N.N", + ) +print doc.unicode(indent=2).encode('utf8') + + |