3.6 "full" packages

Richard A. O'Keefe ok at cs.otago.ac.nz
Tue Jul 29 02:02:50 UTC 2003


Avi Bryant <avi at beta4.com> wrote:
	Then shouldn't this pass?  It doesn't:
	
	testLineEndingsDoNotMatter
	  |text cr crlf|
	  text :=
	'<foo>
	bar
	baz
	</foo>'.
	  cr = XMLDOMParser parseDocumentFrom: text readStream.
	  crlf = XMLDOMParser parseDocumentFrom: text withInternetLineEndings readStream.
	  self assert:
	   (cr elements first contents first string) =
	     (crlf elements first contents first string).
	
Bug 1:  cr is "<foo>bar&#13;baz&#13;</foo>".  The XML specification is
completely clear and unambiguous about this, with no room for weaselling:
line ends MUST be mapped to &#10; (line feed) *NOT* to some other character
that takes your fancy.  The result should be "<foo>bar&#10;baz&#10;</foo>".

Bug 2: crlf is "<foo>bar&#13;&#10;baz&#13;&#10;</foo>".  The fact that this
is not "<foo>bar&#10;baz&#10;</foo>" violates conformance to XML (whether
XML 1.0 1st ed, XML 1.0 2nd ed, or XML 1.1 draft) so badly that it really is
NOT funny.

My own XML parser for Squeak (a) gets line endings right, and (b) makes
string nodes *be* Strings instead of funny things you have to send #string
to.  This test case convinces me that I was right to stick with my own
parser and ignore XMLDOMParser completely.
	
	



More information about the Squeak-dev mailing list