From 45ef91387d5d14fd7d9dbfc8065c721c94f0dd00 Mon Sep 17 00:00:00 2001 From: jjroman Date: Mon, 25 Feb 2013 17:43:45 +0000 Subject: [PATCH] AS7-6390 I think this is the most generic way of dealing with this problem --- src/org/apache/xml/serializer/ToStream.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/org/apache/xml/serializer/ToStream.java b/src/org/apache/xml/serializer/ToStream.java index de5b2f8fc..261f39b3d 100644 --- a/src/org/apache/xml/serializer/ToStream.java +++ b/src/org/apache/xml/serializer/ToStream.java @@ -3020,6 +3020,14 @@ public boolean addAttributeAlways( index = m_attributes.getIndex(rawName); else { index = m_attributes.getIndex(uri, localName); + /* + * SAX parser sometimes returns attributes with no + * uri and localName defined. In such situation + * attribute may be already defined but it is + * not accessible querying by uri and localName + */ + if(index < 0) + index = m_attributes.getIndex(rawName); } if (index >= 0)