Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -27,10 +27,11 @@ #import "OFXMLParser.h" #import "OFXMLElementBuilder.h" #import "OFAutoreleasePool.h" #import "OFInvalidArgumentException.h" +#import "OFMalformedXMLException.h" #import "OFNotImplementedException.h" #import "OFUnboundNamespaceException.h" @interface OFXMLElement_OFXMLElementBuilderDelegate: OFObject { @@ -225,10 +226,14 @@ [parser setDelegate: builder]; [builder setDelegate: delegate]; [parser parseString: str]; + + if (![parser finishedParsing]) + @throw [OFMalformedXMLException newWithClass: isa + parser: parser]; self = [delegate->element retain]; @try { [pool release];