XDMP-VALIDATENODECL means that no element declaration was found for
the validation root (bk:book in this case). Usually this means that the
schema
wasn't being found. Your schema needs to be in the schemas database for
the database of your data (typically, this is the database called
'Schemas').
It either needs to be the only schema for that namespace in scope, or you
to have the location specified somehow. There are a number of options for
this: a binding for it in the Schemas section of your group configuration,
a schema import giving the location of the schema in your query, or you
need
to have an xsi:schemaLocation on the instance itself. I would suggest a
schema import in the query, e.g.
import schema namespace bk="bk = "http://www.harmony.com"
at "/path/to/schema/in/your/schemas/database.xsd";
in place of the namespace declaration.
//Mary
On Sun, 24 May 2009 23:14:42 -0700, Santhosh Raj <[email protected]>
wrote:
Hi Mary,
Then what is the Way to ensure that always my xml should be
validated against the xsd.(while insert, update operations.). I am using
4.0-2 version of Marklogic server.
When i tried using the XQuery validate {} expression. It is giving "
Element declaration not found for validated node in strict mode" for all
tye cases.
Case 1: when i give book node with extra element "<bk:author>Santhosh
</bk:author>". This is acceptable.
xdmp:node-insert-child($b, validate strict { <bk:book>
<bk:title>Arts</bk:title>
<bk:price>200</bk:price>
<bk:author>Santhosh </bk:author>
</bk:book> } )
Case 2: It is giving the same error whem i try to add correct
elements.(i.e) adding only the elements present in the xsd.
xdmp:node-insert-child($b, validate strict { <bk:book>
<bk:title>Arts</bk:title>
<bk:price>200</bk:price>
</bk:book> } )
<error:code>XDMP-VALIDATENODECL</error:code>
<error:name>err:XQDY0084</error:name>
<error:xquery-version>1.0-ml</error:xquery-version>
<error:message>Element declaration not found for validated node in
strict mode</error:message>
Thanks and Regards,
Santhosh Rajasekaran
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general