Hi Abhishek,

Sounds right overall. An MLCP transform gives some flexibility when you want to 
validate or not. If you want to enforce it more strictly, you can use a 
pre-commit trigger, and deny commit if it doesn’t validate by (re)throwing an 
error (or not catching the validate error).

I would recommend using a pre-commit trigger over CPF if it is only for 
validation. CPF comes with extra overhead, and actions run in post-commit too. 
You would not be able to prevent inserts, but only able to flag docs as being 
invalid..

Cheers,
Geert

From: 
<general-boun...@developer.marklogic.com<mailto:general-boun...@developer.marklogic.com>>
 on behalf of "Jain, Abhishek" 
<abhishek.b.j...@capgemini.com<mailto:abhishek.b.j...@capgemini.com>>
Reply-To: MarkLogic Developer Discussion 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Date: Wednesday, September 21, 2016 at 3:03 PM
To: "general@developer.marklogic.com<mailto:general@developer.marklogic.com>" 
<general@developer.marklogic.com<mailto:general@developer.marklogic.com>>
Subject: [MarkLogic Dev General] Validate XML documents while ingesting and 
maintain logs of failed documents #CGO#

Hi Folks,

I’m working on a use-case where I need to ingest bulk documents into Marklogic, 
only those documents which adhere to predefined ( have written my own)
XML schema should be loaded into DB. If fails then details should be written in 
a log file. My approach to achieve this so far is :


1.       Create an XSD.

2.       Write a MLCP transformation module or content processing framework 
module

3.       Validate content of each document inside the module and using try … 
catch block

4.       If content is valid - insert , if not write to failed list (logs)


Am I going right ?
Can anyone share with me the best approach ?
Is there any other way of doing this than mlcp and CPF ?

Thanks and Regards,
[Email_CBE.gif]Abhishek Jain
Associate Consultant
People matter, results count.



This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient, you are not authorized 
to read, print, retain, copy, disseminate, distribute, or use this message or 
any part thereof. If you receive this message in error, please notify the 
sender immediately and delete all copies of this message.
_______________________________________________
General mailing list
General@developer.marklogic.com
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to