abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r421928 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
Date Fri, 14 Jul 2006 15:55:06 GMT
Author: jmsnell
Date: Fri Jul 14 08:55:05 2006
New Revision: 421928

URL: http://svn.apache.org/viewvc?rev=421928&view=rev
Log:
RFC4287 states that all of the metadata elements in atom:feed should come before the list
of atom:entry elements.  
Before this change, if I did feed.addEntry(); feed.addCategory("foo");, it would produce invalid
atom.  Now it checks
to make sure that the category is being inserted before the list of entries.

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

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java?rev=421928&r1=421927&r2=421928&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
Fri Jul 14 08:55:05 2006
@@ -32,6 +32,7 @@
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMXMLParserWrapper;
 
 
@@ -123,6 +124,18 @@
       }
     }
     return source;
+  }
+
+  @Override
+  public void addChild(OMNode node) {
+    if (isComplete() && node instanceof OMElement && !(node instanceof Entry))
{
+      OMElement el = this.getFirstChildWithName(ENTRY);
+      if (el != null) {
+        el.insertSiblingBefore(node);
+        return;
+      }
+    }
+    super.addChild(node);
   }
  
 }



Mime
View raw message