On 10.05.2019 13:21, Costello, Roger L. costello(_at_)mitre(_dot_)org 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.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--