Class EDI::Segment
In: lib/edi4r.rb
lib/edi4r/rexml.rb
Parent: Collection_S

A "Segment" is a special Collection of type "S" (segment-like), similar to "CDE". Special Segment attributes are:

sg_name:The name of its segment group (optional)
level:The segment’s hierarchy level, an integer

Methods

Attributes

level  [R] 
sg_name  [R] 

Public Class methods

Public Instance methods

Access by XPath expression (support is very limited currently) or by name of the dependent component. Pass them as strings.

Used internally - try to avoid at user level! Currently supported XPath expressions:

  • descendant::*
  • descendant-or-self::*
  • child::*
  • child-or-self::*

Returns all child elements of the current segment.

Returns the current segment and all of its child elements. Useful e.g. to deal with one instance of a segment group without traversing included segment groups.

Returns array of all segments that have the current segment as ancestor.

Returns array of all segments with the current segment as ancestor, including the current segment. For trigger segments, this method returns all segments of one instance of the corresponding segment group.

Returns true if segment is a TNode (i.e. a trigger segment). Note that only TNodes may have descendants.

[Validate]