From 685db72924eaf9f29a357ba8fe036c1c3bf1276c Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Thu, 10 Oct 2002 03:16:12 +0000 Subject: [PATCH] Remove xmlns attributes before processing. Delete Attributes object from event after processing. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@195318 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/fo/FOAttributes.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/org/apache/fop/fo/FOAttributes.java b/src/org/apache/fop/fo/FOAttributes.java index 0d152a3e5..85f9dda69 100644 --- a/src/org/apache/fop/fo/FOAttributes.java +++ b/src/org/apache/fop/fo/FOAttributes.java @@ -114,6 +114,10 @@ public class FOAttributes { for (int i = 0; i < attributes.getLength(); i++) { String attrUri = attributes.getURI(i); String attrLocalname = attributes.getLocalName(i); + String attrQName = attributes.getQName(i); + int sep = attrQName.indexOf(':'); + String prefix = attrQName.substring(0, (sep == -1 ? 0 : sep)); + if (prefix.equals("xmlns")) break; String attrValue = attributes.getValue(i); int attrUriIndex = foNode.namespaces.getURIIndex(attrUri); @@ -132,7 +136,7 @@ public class FOAttributes { } catch (PropertyException e) { // Not known - ignore MessageHandler.errorln(event.getQName() + " " - + attributes.getQName(i) + + attrQName + " not recognized. Ignoring."); } } else { // Not the XSL FO namespace @@ -169,6 +173,8 @@ public class FOAttributes { foAttrKeys = (Integer[])(foAttrMap.keySet().toArray(integerArray)); Arrays.sort(foAttrKeys); } + // Finished with the Attributes object + event.setAttributes(null); } /** -- 2.39.5