CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Background
We are starting to work on the techniques for EPUB Accessibility metadata and ONIX. The goal is to provide clear instructions for developers on how to implement these guidelines effectively, extracting and combining the information from the metadata source.
Issue
Given that the key information we identified in the principles document involves analyzing combinations of different metadata, we believe it is crucial to determine the preferred format for conveying instructions to developers. The challenge lies in finding a robust way to communicate which metadata to extract and how to process it to generate the required strings for display to the end users.
Proposed Solutions
We are considering two primary options for conveying these instructions:
-
XSLT (Extensible Stylesheet Language Transformations):
- Both EPUB Accessibility metadata and ONIX formats are XML-based.
- Applying XSLT can directly produce the text to be displayed on-screen.
- This method leverages the XML structure to extract and format the necessary information.
-
Pseudo-code:
- Using a pseudo-code approach allows for a more generalized set of instructions.
- Developers can then adapt the instructions to their specific programming languages and environments.
- This method provides flexibility but may require more effort on the developer's part.
Request for Input
We are reaching out to the community to gather input on which format would be preferable for developers implementing these guidelines. We would appreciate insights, opinions, or any alternative suggestions.
Examples
To illustrate, here's a sample for both techniques regarding the key information Visual adjustments:
XSLT Example
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="https://www.w3.org/1999/XSL/Transform" xmlns:opf="https://www.idpf.org/2007/opf">
<xsl:template match="/">
<xsl:choose>
<!-- Check if accessibilityFeature = displayTransformability is present -->
<xsl:when test="/opf:package/opf:metadata/opf:meta[@property='schema:accessibilityFeature' and text()='displayTransformability']">
<xsl:text>Appearance can be modified.</xsl:text>
</xsl:when>
<!-- Check if accessMode = textOnVisual is present -->
<xsl:when test="/opf:package/opf:metadata/opf:meta[@property='schema:accessMode' and text()='textOnVisual'] and not(/opf:package/opf:metadata/opf:meta[@property='schema:accessibilityFeature' and text()='displayTransformability'])">
<xsl:text>Appearance cannot be modified.</xsl:text>
</xsl:when>
<!-- Default case -->
<xsl:otherwise>
<xsl:text>Modifiability not known.</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Pseudo-code Example
function check_accessibility_feature(metadata):
if metadata['schema:accessibilityFeature'] == 'displayTransformability':
return "Appearance can be modified."
elif metadata['schema:accessMode'] == 'textOnVisual' and metadata['schema:accessibilityFeature'] != 'displayTransformability':
return "Appearance cannot be modified."
else:
return "Modifiability not known."
Note: In the code, an accessibilityFeature and an accessMode are accessed directly as keys to a dictionary, but there may be more than one in the metadata, so preprocessing or loops would be necessary.
Questions:
- Which format do you prefer for conveying these instructions: XSLT or Pseudo-code?
- Do you have any other suggestions or considerations regarding the communication of metadata processing instructions?