[Zope-dev] XMLDocument patch

Gabor Melis gabor.melis@essnet.se
Fri, 19 Nov 1999 20:46:26 +0200


This message is in MIME format
--_=XFMail.1.3.p0.Linux:991119194626:5143=_
Content-Type: text/plain; charset=us-ascii

Hi

I made a patch to remedy two of the present bugs:

1) Escape <, & and > characters in toxml()
2) abort the transaction if parsing fails

1) uses the escape method from xml-sigs xml.utils, but this dependency
can be removed. (not done now)

I was wondering about encodings the other day (subject: XMLDocument
shortcomings). If you have comments on how to introduce intelligent
encoding/decoding please share it with me.

Gabor


--_=XFMail.1.3.p0.Linux:991119194626:5143=_
Content-Disposition: attachment; filename="patch"
Content-Transfer-Encoding: base64
Content-Description: patch
Content-Type: application/octet-stream; name=patch; SizeOnDisk=1475

T25seSBpbiBYTUxEb2N1bWVudC5vcmlnLzogQ1ZTCmRpZmYgLXUgWE1MRG9jdW1lbnQub3JpZy9O
b2RlLnB5IFhNTERvY3VtZW50L05vZGUucHkKLS0tIFhNTERvY3VtZW50Lm9yaWcvTm9kZS5weQlU
dWUgTm92IDE2IDE2OjA5OjIyIDE5OTkKKysrIFhNTERvY3VtZW50L05vZGUucHkJRnJpIE5vdiAx
OSAxOToyNToyOSAxOTk5CkBAIC05OCw2ICs5OCw4IEBACiBpbXBvcnQgc3RyaW5nCiBpbXBvcnQg
Y29weQogCitmcm9tIHhtbC51dGlscyBpbXBvcnQgZXNjYXBlCisKICMgTm9kZSBjbGFzc2VzCiAj
IC0tLS0tLS0tLS0tLQogICAgICAgICAgICAgIApAQCAtNTM3LDcgKzUzOSw3IEBACiAgICAgICAg
IHJlc3VsdC5hcHBlbmQoJzwlcycgJSBzZWxmLl9uYW1lKQogICAgICAgICBmb3IgYSBpbiBzZWxm
LmdldEF0dHJpYnV0ZXMoKToKICAgICAgICAgICAgIGlmIGEuZ2V0Tm9kZVZhbHVlKCk6Ci0gICAg
ICAgICAgICAgICAgcmVzdWx0LmFwcGVuZCgnICVzPSIlcyInICUgKGEuZ2V0TmFtZSgpLGEuZ2V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zZWxmLCBSRVFVRVNULCB0b1hNTD1kYXRh
LAogICAgICAgICAgICAgICAgICAgICAgICAgbWFuYWdlX3RhYnNfbWVzc2FnZT0nPGZvbnQgY29s
b3I9InJlZCI+WE1MIFBhcnNpbmcgRXJyb3I6ICVzPC9mb250PicgJSBtZXNzYWdlKQo=

--_=XFMail.1.3.p0.Linux:991119194626:5143=_--
End of MIME message