On 10.05.2019 13:21, Costello, Roger L. costello@xxxxxxxxx wrote:
My input file consists of a sequence (sourceSeq) of <Byte> elements
representing a sequence of null-terminated strings. I want to create a
function that returns a sequence of <String> elements. For example, with this
sourceSeq:
<Byte>48</Byte>
<Byte>69</Byte>
<Byte>00</Byte>
<Byte>4A</Byte>
<Byte>69</Byte>
<Byte>6C</Byte>
<Byte>6C</Byte>
<Byte>00</Byte>
the function should return:
<String>Hi</String>
<String>Jill</String>
Seems like a job for
<xsl:for-each-group select="Byte" group-ending-with="Byte[. = '00']">
<String>...</String>
</xsl:for-each-group>
where the ... processes current-group()[position() lt last()] to turn
bytes into characters/strings.
|