@@ -22,10 +22,11 @@ #import "OFXMLElement.h" #import "OFXMLAttribute.h" #import "OFXMLCharacters.h" #import "OFXMLCDATA.h" #import "OFXMLComment.h" +#import "OFXMLProcessingInstructions.h" #import "OFXMLParser.h" #import "OFMutableArray.h" #import "OFMalformedXMLException.h" @@ -69,10 +70,19 @@ } - (void)parser: (OFXMLParser*)parser foundProcessingInstructions: (OFString*)pi { + OFXMLProcessingInstructions *node = [OFXMLProcessingInstructions + processingInstructionsWithString: pi]; + OFXMLElement *parent = [stack lastObject]; + + if (parent != nil) + [parent addChild: node]; + else + [delegate elementBuilder: self + didBuildParentlessNode: node]; } - (void)parser: (OFXMLParser*)parser didStartElement: (OFString*)name withPrefix: (OFString*)prefix