I found a PHP library that was capable of doing what you suggested below with a parser at https://github.com/h4cc/multipart.
I’ve not thoroughly used it, but it’s split them up quite nicely! Ashley [cid:[email protected]] [cid:[email protected]] Ashley Peacock Developer II Elevate Credit International Limited P: 01284 717800 | Ext: 877 | Elevate.co.uk<http://elevate.co.uk> Amadeus House, Floral Street, Covent Garden, London WC2E 9DP Privileged and Confidential. This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain privileged and/or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. Elevate Credit International Limited is registered in England & Wales with Company Number 05041905. Registered Office: 27-28 Eastcastle Street, London, W1W 8DH From: [email protected] [mailto:[email protected]] On Behalf Of Ashley Peacock Sent: 19 November 2015 15:58 To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] How To Split Up Multiple Documents In Response Body (PHP) Hi Florent, Thanks for the reply. I figured it would, but at least from my initial Googling it doesn’t. There’s quite a few StackOverflow articles on this topic and other than using some preg_split solutions (which didn’t work in my case, and not a huge fan of regex) there wasn’t much in the way of answers. Ashley From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Florent Georges Sent: 19 November 2015 15:50 To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] How To Split Up Multiple Documents In Response Body (PHP) Hi, It looks like standard multipart to me (although the different boundary separators look suspicious to me). I don't know PHP, but I am sure it must have a multipart parser, most likely as part as its standard HTTP client. Doesn't it? Regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ On 19 November 2015 at 16:45, Ashley Peacock wrote: Hello, I’ve managed to retrieve a batch of documents from the search service, such as: --ML_BOUNDARY_67546754645634 Content-Type: application/xml Content-Disposition: attachment; filename="/2015/11/18/20848763"; category=content; format=xml Content-Length: 11084 (XML GOES HERE) --ML_BOUNDARY_453535345353 Content-Type: application/xml Content-Disposition: attachment; filename="/2015/11/18/20848766"; category=content; format=xml Content-Length: 11121 (XML GOES HERE) I was wondering how best to split them up so they’re usable? I was hoping the MLPHP library had support for this, but it appears it does not. I can split them up using a very dirty method in PHP but there has to be a nice clean way to read them in PHP. I essentially want each XML returned in its own array index. Any ideas? Thanks, Ashley [cid:[email protected]] [cid:[email protected]] Ashley Peacock Developer II Elevate Credit International Limited P: 01284 717800 | Ext: 877 | Elevate.co.uk<http://elevate.co.uk> Amadeus House, Floral Street, Covent Garden, London WC2E 9DP Privileged and Confidential. This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain privileged and/or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. Elevate Credit International Limited is registered in England & Wales with Company Number 05041905. Registered Office: 27-28 Eastcastle Street, London, W1W 8DH [cid:[email protected]] [cid:[email protected]] Ashley Peacock Developer II Elevate Credit International Limited P: 01284 717800 | Ext: 877 | Elevate.co.uk<http://elevate.co.uk> Amadeus House, Floral Street, Covent Garden, London WC2E 9DP Privileged and Confidential. This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain privileged and/or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. Elevate Credit International Limited is registered in England & Wales with Company Number 05041905. Registered Office: 27-28 Eastcastle Street, London, W1W 8DH _______________________________________________ General mailing list [email protected]<mailto:[email protected]> Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general Click here<https://www.mailcontrol.com/sr/zQbyEee0TNTGX2PQPOmvUmaGI8Tu3yGrYdL7Wp7lpXSToLhG88a5V8FzuXCNMBNfFCZpW!alNdk5W2BPFL9JFA==> to report this email as spam.
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
