Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5d68e8e3
Commit
5d68e8e3
authored
Nov 18, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed case sensitivity of attributes (they are case *sensitive*).
parent
eae121e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
Lib/xmllib.py
Lib/xmllib.py
+8
-12
No files found.
Lib/xmllib.py
View file @
5d68e8e3
# A parser for XML, using the derived class as static DTD.
# Author: Sjoerd Mullender
# Author: Sjoerd Mullender
.
import
re
import
string
...
...
@@ -44,14 +44,13 @@ attrfind = re.compile(
# XML parser base class -- find tags and call handler functions.
# Usage: p = XMLParser(); p.feed(data); ...; p.close().
# The dtd is defined by deriving a class which defines methods
# with special names to handle tags: start_foo and end_foo to handle
# <foo> and </foo>, respectively, or do_foo to handle <foo> by itself.
# (Tags are converted to lower case for this purpose.) The data
# between tags is passed to the parser by calling self.handle_data()
# with some data as argument (the data may be split up in arbutrary
# chunks). Entity references are passed by calling
# self.handle_entityref() with the entity reference as argument.
# The dtd is defined by deriving a class which defines methods with
# special names to handle tags: start_foo and end_foo to handle <foo>
# and </foo>, respectively. The data between tags is passed to the
# parser by calling self.handle_data() with some data as argument (the
# data may be split up in arbutrary chunks). Entity references are
# passed by calling self.handle_entityref() with the entity reference
# as argument.
class
XMLParser
:
...
...
@@ -313,8 +312,6 @@ class XMLParser:
attrvalue
=
attrvalue
[
1
:
-
1
]
else
:
self
.
syntax_error
(
self
.
lineno
,
'attribute value not quoted'
)
# XXXX are attribute names case sensitive?
attrname
=
string
.
lower
(
attrname
)
if
attrlist
is
not
None
and
attrname
not
in
attrlist
:
self
.
syntax_error
(
self
.
lineno
,
'unknown attribute %s of element %s'
%
...
...
@@ -565,4 +562,3 @@ def test(args = None):
if
__name__
==
'__main__'
:
test
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment