aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java')
-rw-r--r--src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java b/src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java
index 79c589f9b..7a375ef20 100644
--- a/src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java
+++ b/src/java/org/apache/fop/accessibility/StructureTree2SAXEventAdapter.java
@@ -30,6 +30,7 @@ import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.extensions.ExtensionElementMapping;
import org.apache.fop.fo.extensions.InternalElementMapping;
import org.apache.fop.render.intermediate.IFConstants;
+import org.apache.fop.util.XMLConstants;
/**
* Converts structure tree events to SAX events.
@@ -52,16 +53,19 @@ public final class StructureTree2SAXEventAdapter implements StructureTreeEventHa
}
/** {@inheritDoc} */
- public void startPageSequence(Locale locale) {
+ public void startPageSequence(Locale locale, String role) {
try {
-
+ AttributesImpl attributes = new AttributesImpl();
+ if (role != null) {
+ attributes.addAttribute("", "type", "type", XMLConstants.CDATA, role);
+ }
contentHandler.startPrefixMapping(
InternalElementMapping.STANDARD_PREFIX, InternalElementMapping.URI);
contentHandler.startPrefixMapping(
ExtensionElementMapping.STANDARD_PREFIX, ExtensionElementMapping.URI);
contentHandler.startElement(IFConstants.NAMESPACE,
IFConstants.EL_STRUCTURE_TREE, IFConstants.EL_STRUCTURE_TREE,
- new AttributesImpl());
+ attributes);
} catch (SAXException e) {
throw new RuntimeException(e);
}