abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r439031 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
Date Thu, 31 Aug 2006 19:38:28 GMT
Author: jmsnell
Date: Thu Aug 31 12:38:27 2006
New Revision: 439031

URL: http://svn.apache.org/viewvc?rev=439031&view=rev
Log:
Fix a bug that caused the @type attribute to be reset when calling Content.setValueElement
with XML content

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

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java?rev=439031&r1=439030&r2=439031&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
Thu Aug 31 12:38:27 2006
@@ -105,6 +105,8 @@
       setAttributeValue(TYPE, "html");
     else if (Type.XHTML.equals(type))
       setAttributeValue(TYPE, "xhtml");
+    else if (Type.XML.equals(type))
+      setAttributeValue(TYPE, "application/xml");
     else {
       removeAttribute(TYPE);
     }
@@ -129,8 +131,11 @@
         this.getFirstElement().discard();
       if (value instanceof Div && !type.equals(Content.Type.XML)) 
         init(Content.Type.XHTML);
-      else 
-        init(Content.Type.XML);
+      else {
+        if (this.getMimeType() == null) {
+          init(Content.Type.XML);
+        }
+      }
       this.setFirstChild((OMElement)value);
     } else {
       _removeAllChildren();



Mime
View raw message