diff options
author | scoder <none@none> | 2008-06-19 18:36:42 +0200 |
---|---|---|
committer | scoder <none@none> | 2008-06-19 18:36:42 +0200 |
commit | bb2ec5ab52a61bc0032ff76223c9f5fb6e0dfbac (patch) | |
tree | 18de20728978621055ee04818ce9a9786ef6e143 /src | |
parent | ffbece40a1f50672f80c9baeb89eebba91bde11f (diff) | |
download | python-lxml-bb2ec5ab52a61bc0032ff76223c9f5fb6e0dfbac.tar.gz |
[svn r3830] r4510@delle: sbehnel | 2008-06-16 14:34:42 +0200
docs
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/lxml/builder.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lxml/builder.py b/src/lxml/builder.py index 460d2286..c5c25b74 100644 --- a/src/lxml/builder.py +++ b/src/lxml/builder.py @@ -140,6 +140,17 @@ class ElementMaker(object): <p>And finally, here is an embedded XHTML fragment.</p> </body> </html> + + For namespace support, you can pass a namespace map (``nsmap``) + and/or a specific target ``namespace`` to the ElementMaker class:: + + >>> E = ElementMaker(namespace="http://my.ns/") + >>> print(ET.tostring( E.test )) + <test xmlns="http://my.ns/"/> + + >>> E = ElementMaker(namespace="http://my.ns/", nsmap={'p':'http://my.ns/'}) + >>> print(ET.tostring( E.test )) + <p:test xmlns:p="http://my.ns/"/> """ def __init__(self, typemap=None, |