Loading TOC...

NodeBuilder.startDocument

NodeBuilder.startDocument(
   [$uri as String]
) as This NodeBuilder object

Summary

Start a new document node in the node tree the builder is building.

Parameters
$uri The document URI.

Usage Notes

Document nodes may only be added to an empty node tree.

There is no relationship between the URI of the document and the nodes that may be added to that document. In particular, "example.xml" could contain JSON nodes, and "example.json" could contain XML nodes.

Example

var builder = new NodeBuilder();
builder.startDocument("meta.json");
  builder.addNode(
    {author: "Mary", date: "2014-10-06", keywords: ["example","JSON"]} )
builder.endDocument();
builder.toNode();

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy