Skip to content

Encoder does not support custom encoding algorithms #30

Description

@Tomas-Kraus

1. The Encoder does not write the presence of the optional components (see
C.2.5, C.2.5.1) in the initial vocabulary.
In our case encoding-algorithms flag is not set although we register the
encoding algorithm using:

Encoder.setRegisteredEncodingAlgorithms(…)

Fixed by introduction of a new method:

Encoder.encodeInitialVocabularyOptionalComponentPresence(…)

2. If any of the optional components of the initial vocabulary are present (see
C.2.5.3), the Encoder does not write them to the output.

Fixed by introduction of a new method:

Encoder.encodeInitialVocabularyOptionalComponents(…)

3. The Encoder does not provide a way to map element QNames to an encoding
algorithm URI. This is required to locate an algorithm implementation to encode
the element’s content during processing.

Fixed by two new methods:

FastInfosetSerializer.setRegisteredQNameToAlgorithMappings(…)
FastInfosetSerializer.getRegisteredQNameToAlgorithmMapping(…)

Please see attached Encoder.patch for the list of all required changes.

Examples how to use custom encoding algorithms can be found in the following test:

EncodingTest.testCustomEncodingAlgorithm()

Environment

Operating System: All
Platform: All

Affected Versions

[current]

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions