diff options
author | Walter Doerwald <walter@livinglogic.de> | 2012-02-16 14:40:31 +0100 |
---|---|---|
committer | Walter Doerwald <walter@livinglogic.de> | 2012-02-16 14:40:31 +0100 |
commit | 9dd483d0638b03ac5cc1c4d659fe15c209036aa6 (patch) | |
tree | 967a25334daa194a625a1ccf64c251df30e30824 | |
parent | 2805ad4a5230b1ae789c637ee8cd3d4f6f37b499 (diff) | |
download | python-lxml-walter.tar.gz |
Update source code in validation.txt so that doctests work.walter
-rw-r--r-- | doc/validation.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/validation.txt b/doc/validation.txt index 08374772..51de8a89 100644 --- a/doc/validation.txt +++ b/doc/validation.txt @@ -153,9 +153,9 @@ The DTD information is available as attributes on the DTD object. The method .. sourcecode:: pycon - >>> dtd = etree.DTD(cStringIO.StringIO('<!ELEMENT a EMPTY><!ELEMENT b EMPTY>')) + >>> dtd = etree.DTD(StringIO('<!ELEMENT a EMPTY><!ELEMENT b EMPTY>')) >>> for el in dtd.iterelements(): - >>> print el.name + ... print el.name a b @@ -163,7 +163,7 @@ The method ``elements`` returns the element declarations as a list: .. sourcecode:: pycon - >>> dtd = etree.DTD(cStringIO.StringIO('<!ELEMENT a EMPTY><!ELEMENT b EMPTY>')) + >>> dtd = etree.DTD(StringIO('<!ELEMENT a EMPTY><!ELEMENT b EMPTY>')) >>> print len(dtd.elements()) 2 @@ -201,7 +201,7 @@ element content declaration objects: .. sourcecode:: pycon - >>> dtd = etree.DTD(cStringIO.StringIO('<!ELEMENT a (a|b)+>')) + >>> dtd = etree.DTD(StringIO('<!ELEMENT a (a|b)+>')) >>> con = dtd.elements()[0].content >>> print con.type, con.occur, con.name or plus None @@ -231,7 +231,7 @@ Attributes declarations have the following attributes/methods: Entity declarations are available via the ``iterentities`` and ``entities`` methods: - >>> dtd = etree.DTD(cStringIO.StringIO('<!ENTITY hurz "@">')) + >>> dtd = etree.DTD(StringIO('<!ENTITY hurz "@">')) >>> ent = dtd.entities()[0] >>> print ent.name, ent.orig, ent.content hurz @ @ |