Leave feedback
  • Question

    Reading data from root node of XMLIn event

Enter a new topic
  • Liz Atkins Liz Atkins
    0 likes 418 views

    Hi,

    I'm hoping someone can help me with an XMLIn issue. I need to read an element at root level even though the message I’m working with is reading the XML at the Block 1 level for the structure below.  I was hoping that that I’d still be able to read the elements directly under the root somehow. Is there any way of doing that (other than changing how the message is working)?

    The reason I need to do this is to display ElementA on a StoryTeller page which is otherwise being driven by Block_1.

    Root

    ElementA

    ElementB

                <Block_1>

                            <Block2>

                            Element2C

                            Element2D

                            </Block_2>

                            <Block_3>

                            Element3E

                            Element3F

                            </Block_3>

                </Block_1>

    </Root>

    Thanks,

     Liz

    Friday 19 May, 2017
  • Best Answer
    Andreas Hjelle Andreas Hjelle
    0 likes

    Hi,

    One way could be to create a separate event within the same job that read "ElementA" only. Store whatever you need in global variables and it will be available through the job.

    Regards,

    andreas

    Friday 19 May, 2017
  • Liz Atkins Liz Atkins
    0 likes

    Hi Andreas,

    Thank you for the reply. I hadn't thought of doing it that way. Am I right in thinking that there's no way of traversing the XML to a higher level than that described in the XMLIn?

    Thanks, Liz

    Friday 19 May, 2017
  • Markus Anding Markus Anding StreamServe Employee
    0 likes

    Andreas suggestion is the way to go - most efficient.

    Friday 19 May, 2017
  • Liz Atkins Liz Atkins
    0 likes

    Then that's what I'll do.

    Thank you both for your help :)

    Friday 19 May, 2017

 

Latest from the blogs

Read more