Loading TOC...


   $model as map:map
) as element()*


This function is deprecated and will be removed in a future release.
Generate entity instances of each entity type in a basic model.

model A valid basic model.

Usage Notes

This function is useful for examining what entity instances will look like by default and for testing code that manipulates entities.

A single test entity instance is generated for each entity type defined by the input basic model. Each instance is an XML element that is a valid representation of the entity type, although it might not be exactly what an implementation your application requires.

For each property in an entity type, this function emits an element containing a dummy value of the property's type. If a property is a reference to an entity type that can be resolved local to this model, then an instance of the referenced type is embedded within the referring instance. If a property is an array, only one element of the array item type is generated, but it has a datatype attribute that indicates it is an array. See the example below.

See Also


xquery version "1.0-ml";
import module namespace es = "http://marklogic.com/entity-services"
  at "/MarkLogic/entity-services/entity-services.xqy";

    <es:model xmlns:es="http://marklogic.com/entity-services">
        <es:description>ES Examples</es:description>

(: ==> Two test instances, one for Name and one for Person. MarkLogic
       produces output similar to the following.

  <first>some string</first>
  <middle>some string</middle>
  <last>some string</last>

      <first>some string</first>
      <middle>some string</middle>
      <last>some string</last>
  <bio>some string</bio>
  <phone datatype="array">some string</phone>

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.