Skip to content

Getting item at position? #9

Description

@ajtruckle

Here is xml:

<AssignmentHistory Version="221100" DateLastPurged="2022-06-21">
    <W20200622>
        <Chairman>xxx</Chairman>
        <AuxCounsellor1/>
        <AuxCounsellor2/>
        <VideoConferenceHost>xxx</VideoConferenceHost>
        <VideoConferenceCohost>xxx</VideoConferenceCohost>
        <PrayerOpen>xxx</PrayerOpen>
        <PrayerClose>xxx</PrayerClose>
        <CBSConductor>xxx</CBSConductor>
        <CBSReader>xxx</CBSReader>
        <ReviewQuestion/>
        <Items ItemCount="5">
            <Item>
                <Name>xxx</Name>
                <Theme>“I Will Become What I Choose to Become”</Theme>
                <Method>Talk with Video</Method>
            </Item>
            <Item>
                <Name>xxx</Name>
                <Theme>Digging for Spiritual Gems</Theme>
                <Method>Questions and Answers</Method>
            </Item>
            <Item>
                <Name/>
                <Theme>Prepare This Month’s Presentations</Theme>
                <Method>Discussion with Video</Method>
            </Item>
            <Item>
                <Name>xxx</Name>
                <Theme>Become Jehovah’s Friend​—Jehovah’s Name</Theme>
                <Method>Discussion with Video</Method>
            </Item>
            <Item>
                <Name>xxx</Name>
                <Theme>The Divine Name Is Exalted in Scandinavia</Theme>
                <Method>Discussion with Video</Method>
            </Item>
        </Items>
    </W20200622>
</AssignmentHistory>

Assuming that pWeek represents the node W20200622, how can I get a name at a specific index? For example:

Items[0]/Item/Name

?? I could not see an example. I don't want to just iterate the collection but access a specidic name in the Items list on demand.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions