Now the schema is loaded into MarkLogic, here are some rough notes on handling the "Schema Aware" facets of the server. Again, this information is pulled together from various MarkMail posts and a bit of trial and error:
Executing this should return the element. It should be noted that the formatted example, all the tags appear with lower-case element names. These will need to be changed back if you're following with the example schema and code.
To prove that the content is being validated against the schema, changing the date to something nonsensical (add a couple of random characters in, for example), should yield something like this:
[1.0-ml] XDMP-VALIDATEBADTYPE: (err:XQDY0027) validate strict { $input } -- Invalid node type: emp:DateOfBirth lexical value "2006-05-0ss4" invalid for expected type #xs:date at /emp:Employees/emp:Employee/emp:DateOfBirth using schema "rdl.xsd"
Namespace Prefixed Example
This example may be more useful if you're dealing with elements whose content comes from multiple namespaces:
Subscribe to:
Post Comments (Atom)
Blog Archive
-
►
2011
(35)
-
►
June
(6)
- MarkLogic/XCC: Copying a Module with User Content ...
- MarkLogic: clearing a forest in a database program...
- MarkLogic: Enabling debug options when using the S...
- Linux: SCP syntax and structure note
- MarkLogic/XCC: Installing Modules Programatically
- Eclipse: Installing XQDT (and DLTK) on Eclipse Ind...
-
►
June
(6)
-
▼
2010
(43)
-
►
September
(7)
- MarkLogic: Creating Multiple Range Element Indexes...
- MarkLogic: Listing all Collections in a Database
- MarkLogic: Basic Database Cloning Script
- MarkLogic: Estimating the number of documents cont...
- MarkLogic: Search: Compound OR Queries
- MarkLogic: XQuery: Check for the presence of an el...
- MarkLogic: XQuery: Type Validation using xsi:type
-
►
September
(7)
0 comments:
Post a Comment