[squeak-dev] The Trunk: XML-Parser-mt.46.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Mar 10 14:25:22 UTC 2022


Marcel Taeumel uploaded a new version of XML-Parser to project The Trunk:
http://source.squeak.org/trunk/XML-Parser-mt.46.mcz

==================== Summary ====================

Name: XML-Parser-mt.46
Author: mt
Time: 10 March 2022, 3:25:22.740178 pm
UUID: aa14a081-0390-0545-b55c-0c48ad534a91
Ancestors: XML-Parser-tpr.45

Locale clean-up. Complements Multilingual-mt.269 and System-mt.1318

=============== Diff against XML-Parser-tpr.45 ===============

Item was changed:
  XMLTokenizer subclass: #LazyAttributeListSAXDriver
+ 	instanceVariableNames: 'saxHandler scope useNamespaces validateAttributes language'
- 	instanceVariableNames: 'saxHandler scope useNamespaces validateAttributes languageEnvironment'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'XML-Parser'!

Item was changed:
  ----- Method: LazyAttributeListSAXDriver>>handlePCData: (in category 'handling tokens') -----
  handlePCData: aString
+ 	self language
+ 		ifNotNil: [aString applyLanguageInformation: self language].
- 	self languageEnvironment
- 		ifNotNil: [aString applyLanguageInformation: self languageEnvironment].
  	self saxHandler
  		checkEOD; 
  		characters: aString!

Item was changed:
  ----- Method: LazyAttributeListSAXDriver>>handleStartTag:attributes:namespaces: (in category 'handling tokens') -----
  handleStartTag: elementName attributes: attributeList namespaces: namespaces
  
  	| localName namespace namespaceURI |
  	attributeList ifNotNil: [
  		(attributeList includesKey: 'xml:lang') ifTrue: [
+ 			language := Locale isoString: (attributeList at: 'xml:lang') ] ].
- 			languageEnvironment := LanguageEnvironment localeID: (LocaleID isoString: (attributeList at: 'xml:lang')) ] ].
  
  	self usesNamespaces ifFalse: [
  		"call the handler"
  		self saxHandler
  			checkEOD; 
  			startElement: elementName namespaceURI: nil namespace: nil attributeList: attributeList.
  		^self ].
  	
  	self scope enterScope.
  	"declare any namespaces"
  	namespaces ifNotNil: [
  		namespaces keysAndValuesDo: [:ns :uri |
  			self scope declareNamespace: ns uri: uri] ].
  
  	self splitName: elementName into: [:ns :ln |
  		namespace := ns.
  		localName := ln].
  
  	namespaceURI := self scope 
  		namespaceURIOf: namespace
  		ifAbsent: [self parseError: 'Start tag ' , elementName , ' refers to undefined namespace ' , namespace asString].
  
  	attributeList ifNotNil: [
  		self validatesAttributes ifTrue: [
  			self scope validateAttributes: attributeList ] ].
  	"call the handler"
  	self saxHandler
  		checkEOD; 
  		startElement: localName namespaceURI: namespaceURI namespace: namespace attributeList: attributeList!

Item was added:
+ ----- Method: LazyAttributeListSAXDriver>>language (in category 'accessing') -----
+ language
+ 	^ language!

Item was removed:
- ----- Method: LazyAttributeListSAXDriver>>languageEnvironment (in category 'accessing') -----
- languageEnvironment
- 	^languageEnvironment!

Item was changed:
  ----- Method: SAXDriver>>handleStartTag:attributes:namespaces: (in category 'handling tokens') -----
  handleStartTag: elementName attributes: attributeList namespaces: namespaces
  	"Same as super, but will create and pass and empty Dictionary as attributeList if it is empty."
  
  	| localName namespace namespaceURI |
  	attributeList ifNotNil: [
  		(attributeList includesKey: 'xml:lang') ifTrue: [
+ 			language := Locale isoString: (attributeList at: 'xml:lang') ] ].
- 			languageEnvironment := LanguageEnvironment localeID: (LocaleID isoString: (attributeList at: 'xml:lang')) ] ].
  
  	self usesNamespaces ifFalse: [
  		"call the handler"
  		self saxHandler
  			checkEOD; 
  			startElement: elementName namespaceURI: nil namespace: nil attributeList: (attributeList ifNil: [ Dictionary new ]).
  		^self ].
  	
  	self scope enterScope.
  	"declare any namespaces"
  	namespaces ifNotNil: [
  		namespaces keysAndValuesDo: [:ns :uri |
  			self scope declareNamespace: ns uri: uri] ].
  
  	self splitName: elementName into: [:ns :ln |
  		namespace := ns.
  		localName := ln].
  
  	namespaceURI := self scope 
  		namespaceURIOf: namespace
  		ifAbsent: [self parseError: 'Start tag ' , elementName , ' refers to undefined namespace ' , namespace asString].
  
  	attributeList ifNotNil: [
  		self validatesAttributes ifTrue: [
  			self scope validateAttributes: attributeList ] ].
  	"call the handler"
  	self saxHandler
  		checkEOD; 
  		startElement: localName namespaceURI: namespaceURI namespace: namespace attributeList: (attributeList ifNil: [ Dictionary new ])!



More information about the Squeak-dev mailing list