[xsl] [XSLT Streaming] I xsl:iterate over airport primary records; how do I get the following sibling airport continuation record?

Subject: [xsl] [XSLT Streaming] I xsl:iterate over airport primary records; how do I get the following sibling airport continuation record?
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 31 Jan 2025 19:25:11 -0000
Hi Folks,

I am stream-processing a huge air navigation file that contains, among other
things, airport primary records:

<ARINC>
        ...
        <record>
                <ARINC_424-18_4_1_7_1_Airport_Primary_Records>
                    data about an airport
               </ARINC_424-18_4_1_7_1_Airport_Primary_Records>
        </record>
        ...
</ARINC>

In my program, I iterate over the airport primary records:

<xsl:iterate
select="ARINC/record/ARINC_424-18_4_1_7_1_Airport_Primary_Records">
    process an airport
</xsl:iterate>

Some--not all--airport primary records have a continuation record, which
immediately follows--is the first following sibling--the airport primary
record:

<ARINC>
        ...
        <record>
                <ARINC_424-18_4_1_7_1_Airport_Primary_Records>
                    data about an airport
               </ARINC_424-18_4_1_7_1_Airport_Primary_Records>
        </record>
        <record>
                <ARINC_424-18_4_1_7_3_Airport_Flight_Planning_Continuation_Re
cords>
                    additional data about the airport
               </ARINC_424-18_4_1_7_3_Airport_Flight_Planning_Continuation_Re
cords>
        </record>
        ...
</ARINC>

Within the xsl:iterate loop, I tried to obtain the following continuation
record and store it into a variable:

<xsl:iterate
select="ARINC/record/ARINC_424-18_4_1_7_1_Airport_Primary_Records">
    <xsl:variable name="flt-pln-cont"
select="copy-of(../following-sibling::record[1]/ARINC_424-18_4_1_7_3_Airport_
Flight_Planning_Continuation_Records)"/>
    process the airport and its continuation data
</xsl:iterate>

When I run my program, I get this error message:

Static error at xsl:source-document on line 10 column 47 of
create-airports.xsl:
  XTSE3430  The body of the xsl:source-document instruction is not streamable
  *  Cannot use the following-sibling axis when context posture is CLIMBING
(line 16)
  *  Expression
parent::(element()|document-node())/following-sibling::record[1] requires
  sorting nodes into document order

What is the correct way to do this?

/Roger

Current Thread