From 055aabb32fb900ff3fccde7d9f4dd600602120c8 Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Mon, 7 Nov 2016 12:17:50 +0000 Subject: [PATCH] FOP-2663: AFP tag-logical-element encoding missing from IF xml git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1768506 13f79535-47bb-0310-9956-ffa450edef68 --- .../render/afp/extensions/AFPPageSetup.java | 4 ++ fop/test/intermediate/afp.xml | 45 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 fop/test/intermediate/afp.xml diff --git a/fop-core/src/main/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java b/fop-core/src/main/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java index 27db41d39..12ca5ef38 100644 --- a/fop-core/src/main/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java +++ b/fop-core/src/main/java/org/apache/fop/render/afp/extensions/AFPPageSetup.java @@ -32,6 +32,7 @@ public class AFPPageSetup extends AFPExtensionAttachment { /** value attribute */ protected static final String ATT_VALUE = "value"; + protected static final String ATT_ENCODING = "encoding"; /** placement attribute */ protected static final String ATT_PLACEMENT = "placement"; @@ -145,6 +146,9 @@ public class AFPPageSetup extends AFPExtensionAttachment { if (this.placement != ExtensionPlacement.DEFAULT) { atts.addAttribute(null, ATT_PLACEMENT, ATT_PLACEMENT, "CDATA", placement.getXMLValue()); } + if (encoding != TagLogicalElement.State.ENCODING_NONE) { + atts.addAttribute(null, ATT_ENCODING, ATT_ENCODING, "CDATA", String.valueOf(encoding)); + } handler.startElement(CATEGORY, elementName, elementName, atts); if (content != null && content.length() > 0) { char[] chars = content.toCharArray(); diff --git a/fop/test/intermediate/afp.xml b/fop/test/intermediate/afp.xml new file mode 100644 index 000000000..fd4dbfb9a --- /dev/null +++ b/fop/test/intermediate/afp.xml @@ -0,0 +1,45 @@ + + + + +

+ This test checks that encoding coming from a afp element appear in the IF output. +

+
+ + + + + + + + + + + test + + + + + + + + + +
-- 2.39.5