Loading TOC...

MarkLogic Server 11.0 Product Documentation
es.initSource

es.initSource(
   source-nodes as Sequence,
   entity-type-name as String
) as Sequence

Summary

This function is deprecated and will be removed in a future release.
Return the root node of an entity instance or document. This function is meant for use in code generated by Entity Services.

Parameters
source-nodes The nodes to be normalized. These can be XML element nodes, JSON object nodes, or document nodes.
entity-type-name The name of the entity type for which this function is to generated a source node.

Usage Notes

If an input node is already canonicalized, this function returns the contents of the canonicalized node. Otherwise, this function returns the node as-is. For example, if you pass in an XML element node or JSON object node, this function returns that node. If you pass in a document node, this function returns the XML element node or JSON object node that is the document root.

You will not usually call this function outside of code generated by Entity Services. The generated code uses this function to normalize references to incoming source data to simplify the code. For example, when you generate an instance converter module, the extract-instance-T function for some entity type T calls this function to normalize its input, which might be an XML element node, a JSON object node, or a document node.

See Also

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