I use the XSL 2.0 code below to find the identifiers of text nodes that contain a list of indexes that I give as input. the code works fine, but in terms of performance, it takes a long time for huge files. Even for large files, if the index values are small, the result is fast in a few ms. I am using saxon9he java processor to execute XSL.
<xsl:variable name="insert-data" as="element(data)*">
<xsl:for-each-group
select="doc($insert-file)/insert-data/data"
group-by="xsd:integer(@index)">
<xsl:sort select="current-grouping-key()"/>
<data
index="{current-grouping-key()}"
text-id="{generate-id(
$main-root/descendant::text()[
sum((preceding::text(), .)/string-length(.)) ge current-grouping-key()
][1]
)}">
<xsl:copy-of select="current-group()/node()"/>
</data>
</xsl:for-each-group>
</xsl:variable>
, , , 270962, , XSL, 83427. , , , 4605415, 4605431 . , "insert-data" , . XSL ? XSL.