Any updates please! From: Karunanithi, Bharathi Sent: Thursday, May 25, 2017 8:27 PM To: MarkLogic Developer Discussion Subject: RE: [MarkLogic Dev General] Schema validation fails for certain XMLs #CGO#
I am sure this is not because of the LAX validation. The element structure gets modified and Marklogic 8.0-6.4 adds clear attribute to <br> tags and also other HTML5 deprecated tags to other elements such as <td> etc.,. This happens only while reading the document using xdmp:document-get from shared location / filesystem. The same call does not add any unused attributes to the elements in previous versions. let $path:= "//swcnpny048/2017/Print/Lucky/20170306/XML/GW201703_11_11.xml" let $content := xdmp:document-get($path) When you insert the document to the database and read it by fn:doc, this problem does not occur. I guess there is some parsing issues that adds the new attributes to the documents when you try to read the xml using xdmp:document-get. I tested in other ML versions: ML5 ML 8.0-5.8 ML 8.0-4 This issue is not occurring. I don't want to pick up any default XHTML attributes when we read an xml from a location, maintaining the structure as it is in the source location. Is there any way to do this? Appreciating your help. Thanks in Advance! From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Jain, Abhishek Sent: Wednesday, May 24, 2017 5:15 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Schema validation fails for certain XMLs #CGO# Hi Bharathi, It's not a solution but will help in getting around a solution. I think proper understanding of lax and Strict will help here. I think for any new element (in your case its <br>) Validation will obviously fail if it doesn't comply with XSDs. https://msdn.microsoft.com/en-us/library/dd297062.aspx Thanks and Regards, Abhishek Jain From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Karunanithi, Bharathi Sent: Wednesday, May 24, 2017 4:58 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Schema validation fails for certain XMLs Can I please get any help on the below issue? From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Karunanithi, Bharathi Sent: Tuesday, May 23, 2017 5:20 PM To: MarkLogic Developer Discussion Subject: [MarkLogic Dev General] Schema validation fails for certain XMLs Hi Team, I am getting the following validation error in MarkLogic 8.0-6.4 hosted on a AWS EC2 instance. But certain xml files fails the validation against the Schema particularly in this environment alone. Same XML passes the validation in other ML environments and also from other standalone validation tools using Schemas. The used Schema files are attached in Zip format. Major Schema file being pam.xsd from the zip. Sample XML for which the error is occurring and the error are also attached with this email. Error: Please note that this error only occurs for a xml with a line break tags(<br/> or <br></br>). XML files without any line breaks are passing the Schema Validation. XDMP-VALIDATEUNEXPECTED: (err:XQDY0027) validate lax { $n } -- Invalid node: Found @clear but expected (@title? & @class? & @id?) at fn:doc("//swcnpny048/2017/Print/Lucky/20170306/XML/GW201703_11_11.xml")/pam:message/pam:article/pam-xhtml:body/pam-xhtml:h1/pam-xhtml:br/@clear using schema "pam.xsd" Script: import module namespace validate = "http://condenast.com/dam/2.0/lib/validation" at "/application/lib/validation-lib.xqy"; import module namespace mapping = "http://condenast.com/dam/2.0/lib/mapping" at "/application/lib/mapping-lib.xqy"; import module namespace util = "http://condenast.com/dam/2.0/lib/validation-utils" at "/application/lib/validation-utils.xqy"; declare namespace cndam = "http://condenast.com/dam/2.0"; let $path:= "//swcnpny048/2017/Print/Lucky/20170306/XML/GW201703_11_11.xml" let $assetType:= mapping:get-asset-type-by-extension($path) let $content := xdmp:document-get($path) let $schema := validate:get-schema-from-asset-type($assetType) let $results := util:validate-with-schema( $content, $schema/cndam:namespace/text(), $schema/cndam:schemaLocation/text() ) return $results Please tell me if I am missing any configurations? Or any? Thanks, Bharathi K 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 [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
