Permalink
Browse files

Update source code in validation.txt so that doctests work.

  • Loading branch information...
1 parent 2805ad4 commit 9dd483d0638b03ac5cc1c4d659fe15c209036aa6 @doerwalter doerwalter committed Feb 16, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 doc/validation.txt
View
@@ -153,17 +153,17 @@ 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
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 "&#x40;">'))
+ >>> dtd = etree.DTD(StringIO('<!ENTITY hurz "&#x40;">'))
>>> ent = dtd.entities()[0]
>>> print ent.name, ent.orig, ent.content
hurz &#x40; @

0 comments on commit 9dd483d

Please sign in to comment.