toVar

fnvar toVar(const ref CdmNode node) @safe

Convert a CdmNode to a var value (lossy — strips metadata).

This function recursively converts a CdmNode tree into a lightweight ddn.var tree, discarding all formatting metadata, source locations, and comments. TAG nodes are represented as objects with (#name, #ns, #values, and @attr keys).

Parameters

nodeThe CdmNode to convert.

Returns

A var representing the node's value without metadata.
fnvar toVar(const ref CdmDocument doc) @safe

Convert a CdmDocument to a var value.

Delegates to toVar on the document's root node.

Parameters

docThe CdmDocument to convert.

Returns

A var representing the document's root node.