On Fri, 30 Oct 2009 06:57:44 -0700, Geert Josten <[email protected]> wrote:

Hi Tim,

1.    Validation can take place against a schema without a
namespace and

I haven't tried it on unnamespaced elements, but to my knowledge, you only have the validate construct that you can use:

http://www.w3.org/TR/xquery/#id-validate

This construct cannot be parametrized, which probably means it can only work on namespaced XML. I am sure it needs the namespace to retrieve the appropriate XML schema.

It will work with no-namespaced documents too.  The process of locating
the schema is essentially the same, except it is looking for a schema with
no target namespace.

The schema is located by: (1) looking for an xsi:schemaLocation
(or, in this case, an xsi:noNamespaceSchemaLocation) on the
document itself, (2) looking for an explicit module import for that
namespace (or non-namespace) in the query prolog, (3) looking in
the schemas database, (4) reverting to built-in schemas.
In the case of (3), the server settings that bind namespaces to schema
locations will be used for disambiguation (otherwise the server will
use the first schema it finds for that namespace).


It is possible though to apply a namespace to all elements on the fly an pass that to the validate construct. A precommit trigger would be quite suitable for this, so it would apply to webdav inserts as well.

2.    The loader will ignore the DTD reference in the XML document.

DOCTYPE will ignored. In fact I believe the whole prolog is removed upon storage in MarkLogic database.

"Removed" isn't quite the right verb: the XML parser parses it, but it isn't
part of the XML Data Model.  The server will process any internal subset
to the extent of resolving named entities.


Make sure to anticipate on the source encoding though, if it might vary. You might need to analyse the prolog yourself before calling document-insert. In this thread some tips how to handle this: http://markmail.org/thread/74zeihtzez4mjnc4

Kind regards,
Geert


//Mary

[email protected]
Principal Engineer
Mark Logic Corporation
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to