Hi friends,
i am also facing some problem with schema validation, i have followed
all the steps
at http://developer.marklogic.com/howto/tutorials/2007-04-schema.xqy .
I tested it and it is working fine as per tutorial.
But i removed some of the required elements from xml and i did
schema validation on the new xml.
the validate function did not throw any exceptions. as per schema the
xml file is wrong, but i failed to get exception by using marklogic
function.
how to use validate lax {$node} , i want to chk a xml file with schema
before inserting .
Please help me out. What I need to do so that when I load a new xml file
into the database then MarkLogic should validate it before loading
and also
will it possible to check on collection level, with out providing
schema location in xml file.
Thanks and Regards,
Ashwini.
------------------------------------------------------------------------------------------------------------------------
Today's Topics:
1. Re: possible to use a xml schema withouta target namespace?
(Mary Holstege)
2. Re: Content Streaming within MarkLogic (Frank Rubino)
----------------------------------------------------------------------
Message: 1
Date: Thu, 08 Oct 2009 08:14:57 -0700 From: "Mary Holstege"
<[email protected]>
Subject: Re: [MarkLogic Dev General] possible to use a xml schema
withouta target namespace?
To: "General Mark Logic Developer Discussion"
<[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8
On Thu, 08 Oct 2009 06:04:50 -0700, <[email protected]> wrote:
Hi Michael,
>> I have followed all the steps those you have discussed in your tutorial
>> at http://developer.marklogic.com/howto/tutorials/2007-04-schema.xqy . I
>> tested it and it is working fine as per your tutorial.
>> The problem is when change the tutorial.xml <born> field data from a
>> valid date by a string, and then I load this tutorial.xml again into the
>> database; this time it should not be loaded into the database because it
>> is not the proper xml according the tutorial.xsd. But it is loaded
>> successfully into the database. I mean to say while I load a new
>> document then MarkLogic xml schema validation is not working.
>>
>> Please help me out. What I need to do so that when I load a new xml file
>> into the database then MarkLogic should validate it before loading ,and
>> if it is not correct then MarkLogic should throw some error.
>>
>> Regards,
>> Anuj Kumar
>
> Validation (and reporting of errors) is only performed in XQuery via
> the validate expression (you can validate individual elements: it doesn't
> have to be the whole document, FYI):
>
> validate strict { fn:doc("mydoc.xml") }
>
> This expression will throw an error if the node was invalid per the
> schema or if no schema was found.
>
> Schema information is used on load only to assist in repair (if you have
> repair turned on) and to determine whitespace handling. Validation is
> not performed on load. You may want to load invalid content and use
> XQuery to fix it up, and you can do this. Schema information is also
> used to obtained type information as required in a particular query.
> For example, if you have a function with an argument declared to be
> of a particular type, MarkLogic Server will make use of schema information
> to check that. If you ask for a typed value (e.g. via fn:data) schema
> information is used to return you an item of the proper type, and you
> may get a type error at that point. In your document above,
> fn:data on the born element would give you an error, as would
> a call to the validate expression.
>
> If what you want to do is validate each document you load into the
> database, you need to make a load script that does that, e.g.
>
> xdmp:document-insert("/db/path/mydoc.xml",
> validate strict { xdmp:document-get("/example/mydoc.xml") } )
>
> //Mary
>
> [email protected]
> Principal Engineer
> Mark Logic Corporation
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 8 Oct 2009 09:17:14 -0700
> From: Frank Rubino <[email protected]>
> Subject: Re: [MarkLogic Dev General] Content Streaming within
> MarkLogic
> To: General Mark Logic Developer Discussion
> <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="utf-8"
>
> You can avoid building and delivering a complete page using Ajax as
> you describe. Another delivery solution is flex. You can create an xqy
> controller that handles asynchronous requests from the various data
> driven ui components.
>
> Frank Rubino
>
> On Oct 8, 2009, at 10:29 AM, "McBeath, Darin W (ELS-STL)"
> <[email protected]
> > wrote:
>
>> One thing which I’ve noticed as I’ve written customer facing apps
>> in XQuery is the inability to stream a dynamically constructed XHTML
>> page, RSS feed, etc. from the MarkLogic server. In other words, th
>> e entire page/response must be built in memory before the first byte
>> can be shipped to the client. In some situations, this can be reso
>> lved by better page design, AJAX, etc. but this is always not practi
>> cal. I’m not really talking about the ability to support ‘byte
>> serving’ for binary content (such as PDFs) … that is a completely
>> different scenario (which of course others might find beneficial if
>> it were addressed). I also understand this might be attributed to
>> the XQuery specification and how things need to operate (well-formed
>> ness, etc.); but, on the other hand proprietary extensions are freq
>> uently added by vendors. So, I’m curious whether others have encou
>> ntered this situation and perceive it as an issue for developing cus
>> tomer facing apps in XQuery.
>>
>>
>>
>> Darin.
>>
>> _______________________________________________
>> General mailing list
>> [email protected]
>> http://xqzone.com/mailman/listinfo/general
>
> ------------------------------
>
> _______________________________________________
> General mailing list
> [email protected]
> http://xqzone.com/mailman/listinfo/general
>
>
> End of General Digest, Vol 64, Issue 24
> ***************************************
>
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general