简体   繁体   中英

Receiving “Namespace prefix 'bin' has not been declared” error - Saxon's XSL3

I tried using the bitwise library on Saxon's XSL3 (-PE), but keep receiving the following error message:

XPST0081: Namespace prefix 'bin' has not been declared

The line that contains the bin code looks like that:

<xsl:variable name="firstCharPos" select="bin:shift(bin:hex('000001'), 17)"/>

And my stylesheet section looks like that:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:saxon="http://saxon.sf.net/"
    xmlns:mf="http://example.com/mf"
    extension-element-prefixes="saxon"
    exclude-result-prefixes="xs saxon mf"
    version="3.0">

Am I missing something? Should I include the 'bin' library somehow?

Thanks!

You need to add the namespace declaration

 xmlns:bin="http://expath.org/ns/binary"

You might also want to add "bin" to the list of prefixes in exclude-result-prefixes (or change it to exclude-result-prefixes="#all" ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM