This affects at least 2.6.4 to current versions. In TreeTraversingParser#getBinaryValue, a Base64Variant is accepted but ignored. The call to n.binaryValue(), when n is a TextNode, then uses the default Base64 variant instead of what's specified. It seems the correct behavior would be to call TextNode#getBinaryValue instead.