Adding Composite Repeating Elements

Index

    Adding Composite Repeating Elements

    A composite LightWeightElement can have repeating composite elements.

    Example

    // Create a composite element
    LightWeightElement compositeElement = new LightWeightElement(true);
    compositeElement.Elements.Add(new LightWeightElement(“Composite Element”));
    compositeElement.Elements.Add(new LightWeightElement(“Composite Element”));
    compositeElement.Elements.Add(new LightWeightElement(“Composite Element”));
     
    // Add the first repeating composite element
    compositeElement.RepeatingCompositeElements.Add(newLightWeightElements());
     
    compositeElement.RepeatingCompositeElements[0].Add(newLightWeightElement(“Composite Element 1”));
    compositeElement.RepeatingCompositeElements[0].Add(newLightWeightElement(“Composite Element 1”));
    compositeElement.RepeatingCompositeElements[0].Add(newLightWeightElement(“Composite Element 1”));
    compositeElement.RepeatingCompositeElements[0].Add(newLightWeightElement(“Composite Element 1”));
     
    // Add the second repeating composite element
    compositeElement.RepeatingCompositeElements.Add(newLightWeightElements());
     
    compositeElement.RepeatingCompositeElements[1].Add(newLightWeightElement(“Composite Element 2”));
    compositeElement.RepeatingCompositeElements[1].Add(newLightWeightElement(“Composite Element 2”));
    compositeElement.RepeatingCompositeElements[1].Add(newLightWeightElement(“Composite Element 2”));
    compositeElement.RepeatingCompositeElements[1].Add(newLightWeightElement(“Composite Element 2”));
    In order for the repeating values to be delimited correctly please set RepetitionCharacter to the desired character.
    in EDI Lightweight Document
    Did this article answer your question?