Project

Profile

Help

Bug #5690 ยป binUnpack_bug.xsl

stylesheet to reproduce - Olivier XILLO, 2022-09-17 16:03

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:bin="http://expath.org/ns/binary"
exclude-result-prefixes="xs bin"
version="3.0">
<xsl:template name="xsl:initial-template">
<xsl:message>0x8008 as little endian unsigned short <xsl:value-of select="bin:unpack-unsigned-integer(bin:hex('8008'),0,2,'LE')"/> - expected 2176</xsl:message>
<xsl:message>0x8008 as big endian unsigned short <xsl:value-of select="bin:unpack-unsigned-integer(bin:hex('8008'),0,2,'BE')"/> - expected 32776</xsl:message>
<xsl:message>0x8008 as little endian unsigned short <xsl:value-of select="bin:unpack-integer(bin:hex('8008'),0,2,'LE')"/> - expected 2176</xsl:message>
<xsl:message>0x8008 as big endian unsigned short <xsl:value-of select="bin:unpack-integer(bin:hex('8008'),0,2,'BE')"/> - expected -32760</xsl:message>
</xsl:template>
</xsl:stylesheet>
    (1-1/1)