abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r564981 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
Date Sat, 11 Aug 2007 22:07:17 GMT
Author: jmsnell
Date: Sat Aug 11 15:07:16 2007
New Revision: 564981

URL: http://svn.apache.org/viewvc?view=rev&rev=564981
Log:
Account for wrapper elements

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java?view=diff&rev=564981&r1=564980&r2=564981
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
Sat Aug 11 15:07:16 2007
@@ -182,7 +182,21 @@
     return t;
   }
 
+  private Element getInternal(Element element) {
+    if (element instanceof ElementWrapper) {
+      ElementWrapper wrapper = (ElementWrapper) element;
+      element = wrapper.getInternal();
+    }
+    return element;
+  }
+  
   public void addExtension(Element extension, Element before) {
+    extension = getInternal(extension);
+    before = getInternal(before);
+    if (before instanceof ElementWrapper) {
+      ElementWrapper wrapper = (ElementWrapper) before;
+      before = wrapper.getInternal();
+    }
     if (before == null) {
       addExtension(extension);
     } else {
@@ -198,7 +212,7 @@
       addExtension(element);
     } else {
       element.setParentElement(this);
-      el.insertSiblingBefore((OMElement)element);
+      el.insertSiblingBefore((OMElement)getInternal(element));
     }
     return element;
   }



Mime
View raw message