[Home] [By Thread] [By Date] [Recent Entries]
On 12.03.2019 20:21, Eliot Kimber ekimber@xxxxxxxxxxxx wrote:
I was thinking of doing something with looking up the individual byte() elements using key() on the string values but I couldn't think of an elegant way to split the input string into two-character chunks. Interesting, why do you need the string splitting for the key? Wouldn't <xsl:param name="input" as="xs:string">04000000FF</xsl:param> <xsl:variable name="len" as="xs:integer" select="string-length($input) idiv 2"/> <xsl:key name="window" match="Bytes/Byte" use="string-join((., following-sibling::Byte[position() lt $len]))"/> <xsl:template match="/"> <xsl:value-of select="count(key('window', $input)[1]/preceding-sibling::Byte)"/> </xsl:template> do?
|

Cart



