We do validation externally, as you allude to. Generally we do this before
loading the data as a command-line batch process; then we validate within
our Java web app framework when making interactive updates.  We have
implemented a transform service that processes documents using XSLT and
called that from ML xquery; it all worked fine.  Some transformations are
just easier to code in xslt; you don't need to write an entire recursive
tree-walker every time.  I suspect a validation service would be fairly
straightforward.

-Mike

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James A.
Robinson
Sent: Friday, January 19, 2007 7:23 PM
To: [email protected]
Cc: Todd McGee
Subject: [MarkLogic Dev General] MarkLogic Server and schema interaction



Hi folks,

Looking through the documentation, it appears to me that MarkLogic offers
some, but not all, of the features of schema validation as exists in the
XQuery specification?

I've been looking at loading some schema and associated instances into our
test server, and I can see that it is Doing The Right Thing with regard to
typecasting when faced with things like

        element(*, [type])

But it appears that validate {} are not currently implemented?

If my understanding is correct, I'd like to ask people how they generally
manager validation of XML they construct from within MarkLogic Server as
they shuffle data around in XQuery programs?

As an example of what I'm after, I've been playing around with writing some
functions which, using Saxon, define things in terms of strict schema
validation:

  declare function resource:ancestry(
    $uri as xs:anyURI)
  as schema-element(lin:ancestry) {
    validate {
      ...
      element {'lin:ancestry'} {
        ... construct contents ...
      }
      ...
    }
  }

with such a function I be assured, in Saxon, that the ancestory element
which is returned is valid according to the schema.  It looks like that
isn't directly possible.  That is to say, I can be assured I am returning
the proper *class* of element (e.g., named lin:ancestry, or in the general
class of seq:sequence if lin:ancestry descends from a complexType named
seq:sequence) -- but I can't promise that the contents of the element itself
are actually valid.

If the answer is "We don't worry about it," so be it. :)

My second question was on whether or not people used external validation
with their MarkLogic Server instances?  It looks to me like we could pretty
easily use the http POST functionality available to post documents to a
validation service, do any of you use this technique, or have you found it
easier to use some other technique?


Jim

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
James A. Robinson                       [EMAIL PROTECTED]
Stanford University HighWire Press      http://highwire.stanford.edu/
+1 650 7237294 (Work)                   +1 650 7259335 (Fax)
_______________________________________________
General mailing list
[email protected] http://xqzone.com/mailman/listinfo/general

_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to