abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r417892 - in /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax: FOMContent.java FOMText.java
Date Wed, 28 Jun 2006 22:47:08 GMT
Author: jmsnell
Date: Wed Jun 28 15:47:08 2006
New Revision: 417892

URL: http://svn.apache.org/viewvc?rev=417892&view=rev
Log:
Whoops.  The overridden getLanguage wasn't working right.

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMContent.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.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=417892&r1=417891&r2=417892&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
Wed Jun 28 15:47:08 2006
@@ -30,6 +30,7 @@
 import org.apache.abdera.model.Div;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.ExtensionElement;
+import org.apache.abdera.model.Text.Type;
 import org.apache.abdera.util.Constants;
 import org.apache.axiom.attachments.DataHandlerUtils;
 import org.apache.axiom.om.OMContainer;
@@ -314,10 +315,11 @@
   
   @Override
   public String getLanguage() {
-    return (!Type.XHTML.equals(type)) ?
-      super.getLanguage() : 
-      (getValueElement() != null) ? 
-         getValueElement().getLanguage() : 
-         super.getLanguage();
+    if (Type.XHTML.equals(type)) {
+      Element el = getValueElement();
+      if (el.getAttributeValue(LANG) != null)
+        return el.getAttributeValue(LANG);
+    }
+    return super.getLanguage();
   }
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java?rev=417892&r1=417891&r2=417892&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMText.java
Wed Jun 28 15:47:08 2006
@@ -200,11 +200,12 @@
   
   @Override
   public String getLanguage() {
-    return (!Type.XHTML.equals(type)) ?
-      super.getLanguage() : 
-      (getValueElement() != null) ? 
-         getValueElement().getLanguage() : 
-         super.getLanguage();
+    if (Type.XHTML.equals(type)) {
+      Element el = getValueElement();
+      if (el.getAttributeValue(LANG) != null)
+        return el.getAttributeValue(LANG);
+    }
+    return super.getLanguage();
   }
 
 }



Mime
View raw message