Step epub3-merge-prefix {http://www.daisy.org/ns/pipeline/xproc}

Merge prefix attributes

Defined in: http://www.daisy.org/pipeline/modules/epub-utils/library.xpl

Input Ports

Port Description
source primary

OPF or HTML document that may have more than one prefix (epub:prefix) attribute.

prefix attributes are allowed on any element, not only on package or html.

If an element has more than one ancestor element with a prefix, all except the closest one are ignored.

Output Ports

Port Description
result primary

The result document has at most one prefix attribute, on the root element. The different prefix attributes in the input document are merged in such a way that every prefix is unique and no two prefixes are mapped to the same URI. The document is updated at the places where a prefix is used that was renamed. Prefixes that are not used anywhere inside the document are skipped from the declaration.

Options

Local Name Namespace URI Default Description
implicit-input-prefixes 'a11y: http://www.idpf.org/epub/vocab/package/a11y/# dc: http://purl.org/dc/elements/1.1/ dcterms: http://purl.org/dc/terms/ marc: http://id.loc.gov/vocabulary/ media: http://www.idpf.org/epub/vocab/overlays/# onix: http://www.editeur.org/ONIX/book/codelists/current.html# rendition: http://www.idpf.org/vocab/rendition/# schema: http://schema.org/ xsd: http://www.w3.org/2001/XMLSchema#'

Prefix declarations that are assumed in the input, i.e. they don't need to be declared in order to be recognized.

implicit-output-prefixes '#default'

Prefix declarations that will be omitted from the output.

By default (#default) prefixes that are used but not declared (i.e. implied) in the input are also implied in the output.