IPWorks EDI 2020 Node.js Edition

Questions / Feedback?

BuildDOM Property

When True, an internal object model of the EDI document is created.

Syntax

 edifactreader.getBuildDOM([callback])
 edifactreader.setBuildDOM( buildDOM, [callback])

Possible Values

  0 (bdEntireDocument), 
  1 (bdInterchange), 
  2 (bdTransaction), 
  3 (bdNone)

Default Value

0

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for the getBuildDOM([callback]) method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

The callback for the setBuildDOM([callback]) method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

Set BuildDOM to bdEntireDocument (0) when you need to browse the current document through XPath.

Use bdInterchange (1) when parsing large documents to tell the class to only hold an internal object model of the current Interchange being parsed. When this value is used, and a new Interchange is encountered during parsing, the old interchange is cleared from memory. If the input contains a single Interchange, this is equivalent to using bdEntireDocument.

Use bdTransaction (2) when parsing large documents to tell the class to only hold an internal object model of the current transaction being parsed. When this value is used, and a new transaction is encountered during parsing, the old transaction is cleared from memory.

A value of bdNone (3) will tell the class to not save any internal state of the document being parsed, and thus XPath will be unavailable.

Data Type

Integer

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Node.js Edition - Version 20.0 [Build 8203]