1
0

2 Коммиты afe15f59ef ... b273123456

Автор SHA1 Сообщение Дата
  Christian Haider b273123456 added xml namespace extension 4 лет назад
  Christian Haider afe15f59ef added xml namespace extension 4 лет назад
1 измененных файлов с 6 добавлено и 19 удалено
  1. 6 19
      src/Silk.st

+ 6 - 19
src/Silk.st

@@ -58,10 +58,10 @@ namespace
 	XML namespace for elements: html.
 	The default for all virtual Silk tag messages"
 	
-	^self element namespaceURI
+	^ self element namespaceURI
 ! !
 
-!Silk methodsFor: 'error handling'!
+!Silk methodsFor: 'writing'!
 
 doesNotUnderstand: aMessage
 	"`aSilk DIV` creates a div element and inserts it.
@@ -70,9 +70,7 @@ doesNotUnderstand: aMessage
 	(self class tryMakeDnuElement: aMessage in: self)
 		ifNil: [ ^ super doesNotUnderstand: aMessage ]
 		ifNotNil: [ :newElement | self << newElement. ^ newElement ]
-! !
-
-!Silk methodsFor: 'writing'!
+!
 
 nextPut: anObject
 	"Double-dispatches anObject via renderOnSilk: message.
@@ -90,7 +88,7 @@ htmlNamespace
 	XML namespace for HTML elements.
 	The default for all virtual Silk tag messages"
 	
-	^'http://www.w3.org/1999/xhtml'
+	^ 'http://www.w3.org/1999/xhtml'
 !
 
 namespace
@@ -98,22 +96,11 @@ namespace
 	XML namespace for elements: html.
 	The default for all virtual Silk tag messages"
 	
-	^self htmlNamespace
+	^ self htmlNamespace
 ! !
 
 !Silk class methodsFor: 'instance creation'!
 
-newElement: aString in: aSilk
-	"<Silk>
-	creates a new element in the same xml namespace as aSilk.
-	When aSilk is the class Silk, the default behavior applies (html namespace for new elements)"
-	
-	aSilk namespace = self htmlNamespace ifTrue: [
-		^self newElement: aString].
-	"actually, the lines above are not needed if you want to use the namespaced method always"
-	^self newElement: aString xmlns: aSilk namespace
-!
-
 tryMakeDnuElement: aMessage in: aSilk
 	"`DIV` creates a div element.
 	`DIV: anObject` creates a div element and puts contents in it.
@@ -134,7 +121,7 @@ tryMakeDnuElement: aMessage in: aSilk
 		ifFalse: [ useArg := false ].
 	(selector includes: ':')
 		ifTrue: [ ^ nil ].
-	newElement := self newElement: selector asLowercase in: aSilk.
+	newElement := self newElement: selector asLowercase xmlns: aSilk namespace.
 	useArg ifTrue: [ newElement << aMessage arguments first ].
 	^ newElement
 ! !