Copyright © 2011-2013 Claudius Teodorescu, published by the EXPath Community Group under the W3C Community Contributor License Agreement (CLA) . A human-readable summary is available.
This specification was published by the EXPath Community Group . It is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. Learn more about W3C Community and Business Groups .
This proposal provides a Digital Publishing module for XPath 2.0. It defines extension functions for converting from one digital format to another, to execute various processing operations of digital documents, etc. It has been designed to be compatible with XQuery 1.0 and XSLT 2.0, as well as any other standard based on XPath 2.0.
As this is a work in progress, more details about it can be found at Digital Publishing Functions Comparison.
1 Introduction
1.1 Namespace conventions
1.2 Error management
2 General Functions
2.1 The digi-pub:get-module-metadata() Function
2.1.1 The digi-pub:module-metadata element
2.2 The digi-pub:transform() Function
2.2.1 The Formats
2.2.2 The Syntax for $transformation-formula parameter
2.2.3 The digi-pub:options element
2.3 The digi-pub:get-resource-metadata() Function
2.4 The digi-pub:set-resource-metadata() Function
3 Numeric Identifiers For Publications
3.1 The digi-pub:validate-identifier() Function
3.2 The digi-pub:parse-identifier() Function
This Digital Publishing module allows publishing and processing of digital documents.
The module defined by this document defines functions and elements in the namespace
http://expath.org/ns/digi-pub
. In this document, the
digi-pub
prefix, when used, is bound to this namespace URI.
Error codes are defined in the namespace http://expath.org/ns/error
. In
this document, err
prefix, when used, is bound to this namespace
URI.
These are general purpose functions, for general processing of documents, regardless their formats.
digi-pub:get-module-metadata()
Function
This function is used for getting the metadata of this module. It returns the module metadata.
digi-pub:get-module-metadata
() aselement(digi-pub:module-metadata)
digi-pub:transform()
Function
This function is used to transform a document from one digital publishing format to another.
digi-pub:transform
($transformation-formula asxs:string
, $input-document asxs:anyAtomicType
, $options aselement(digi-pub:options)?
) asxs:anyAtomicType*
$transformation-formula
is the formula used to specify the source format and the target format. These formulae
are detailed below. If the transformation formula is not supported,
this is an error [err:DPUB001].
$input-document
is the document to be transformed from source format to target format.
$options
are the options for the current operation.
Below are the input/output formats:
pdf (Portable Document Format), html (Hypertext Markup Language), txt (Plain Text), epub (Open eBook), rtf (Rich Text Format), docbook (DocBook), xslfo (Extensible Stylesheet Language Formatting Objects), pptx (PowerPoint Open XML Presentation), svg (Scalable Vector Graphics).
$transformation-formula
parameter
The syntax for $transformation-formula
parameter is as follows:
$input-format
-to-$output-format
If the syntax of the transformation formula is wrong, this is an error [err:DPUB004].
If neither the input format, or output format is supported, this is an error [err:DPUB001].
digi-pub:get-resource-metadata()
Function
This function is used for getting the metadata of a resource. It returns the resource metadata.
digi-pub:get-resource-metadata
($resource-path asxs:string
) aselement(digi-pub:resource-metadata)
$resource-path
is the path of the resource. If the path is not correct,
this is an error [err:DPUB002]. If the user has no rights
to access the path, this is an error [err:DPUB003].
digi-pub:set-resource-metadata()
Function
This function is used for setting the metadata of a resource. It returns true if successfully completed, false if not.
digi-pub:set-resource-metadata
($resource-path asxs:string
, $new-resource-metadata aselement(digi-pub:resource-metadata
) asxs:boolean
$resource-path
is the path of the resource. If the path is not correct,
this is an error [err:DPUB002]. If the user has no rights
to access the path, this is an error [err:DPUB003].
$new-resource-metadata
is the new resource metadata.
These are functions for validation and conversion of numeric identifiers for publications. The numeric identifiers can be of type ISBN, ISSN, and DOI.
digi-pub:validate-identifier()
Function
This function is used for validating the publication's numeric identifier. It returns true if successfully completed, false if not.
digi-pub:validate-identifier
($identifier asxs:string
) asxs:boolean
$identifier
is the publication's numeric identifier.
digi-pub:parse-identifier()
Function
This function is used for parsing the publication's numeric identifier. It returns digi-pub:identifier element, whose content varies according to the identifier, as it is detailed below.
digi-pub:parse-identifier
($identifier asxs:string
) aselement(digi-pub:identifier)
$identifier
is the publication's numeric identifier.