fixed namespace parsing in VWXMLReader
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 02 Jun 2008 20:41:58 +0000
changeset 16 1bda271d9ca2
parent 15 2e4ef5517c5e
child 17 3f9eeb1c1911
fixed namespace parsing in VWXMLReader
xmlreaderimpl/trunk/XMLv2__VWXMLReader.st
xmlreaderimpl/trunk/stx_goodies_xmlsuite_xmlreaderimpl.st
--- a/xmlreaderimpl/trunk/XMLv2__VWXMLReader.st	Wed May 14 11:48:13 2008 +0000
+++ b/xmlreaderimpl/trunk/XMLv2__VWXMLReader.st	Mon Jun 02 20:41:58 2008 +0000
@@ -274,6 +274,36 @@
     "Created: / 25-10-2005 / 13:09:54 / janfrog"
 ! !
 
+!VWXMLReader::XMLParser methodsFor:'attribute processing'!
+
+processAttributes
+    |attributes attr keys|
+
+    attributes := nil.
+    [
+        self skipSpace.
+        self isValidNameStart:hereChar
+    ] whileTrue:[
+        attributes == nil ifTrue:[
+            attributes := OrderedCollection new.
+            keys := Set new.
+        ].
+        attr := self attribute.
+        attributes add:attr.
+        "(keys testAndAdd:attr key) ifTrue:[
+            self notPermitted:'two attributes with the same name'
+        ]."
+         "
+         (attributes collect: [:i | i key]) asSet size = attributes size
+         ifFalse: [self notPermitted: 'two attributes with the same name']
+
+        "
+    ].
+    ^ attributes
+
+    "Created: / 02-06-2008 / 19:28:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
+! !
+
 !VWXMLReader::XMLParser methodsFor:'element processing'!
 
 elementContent: tag openedIn: str
--- a/xmlreaderimpl/trunk/stx_goodies_xmlsuite_xmlreaderimpl.st	Wed May 14 11:48:13 2008 +0000
+++ b/xmlreaderimpl/trunk/stx_goodies_xmlsuite_xmlreaderimpl.st	Mon Jun 02 20:41:58 2008 +0000
@@ -9,21 +9,23 @@
 
 !stx_goodies_xmlsuite_xmlreaderimpl class methodsFor:'description'!
 
-preRequisites
-    ^ #(
-        #'stx:goodies/xml/vw'    "XML::XMLParser - superclass of XMLv2::VWXMLReader::XMLParser "
-        #'stx:goodies/xmlsuite/core'    "XMLv2::XMLReader - superclass of XMLv2::ExpatXMLReader "
-        #'stx:libbasic'    "Object - superclass of XMLv2::VWXMLReader "
-    )
-
-!
-
 preLoadAction
 	ObjectFileLoader searchedLibraries:
 	        (ObjectFileLoader searchedLibraries asOrderedCollection
 			add: '/usr/lib/libexpat.so';
 			yourself) asArray
 
+!
+
+preRequisites
+    ^ #(
+        #'stx:goodies/xml/vw'    "XML::XMLParser - superclass of XMLv2::VWXMLReader::XMLParser "
+        #'stx:goodies/xmlsuite/core'    "XMLv2::XMLReader - superclass of XMLv2::ExpatXMLReader "
+        #'stx:libbasic'    "Object - superclass of XMLv2::VWXMLReader "
+        #'stx:libcomp'    "ObjectFileLoader - referenced by stx_goodies_xmlsuite_xmlreaderimpl class>>preLoadAction "
+    )
+
+    "Modified: / 02-06-2008 / 22:37:47 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
 !stx_goodies_xmlsuite_xmlreaderimpl class methodsFor:'description - contents'!